Java Code Examples for com.smartgwt.client.widgets.layout.VLayout#addMember()

The following examples show how to use com.smartgwt.client.widgets.layout.VLayout#addMember() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DigitalObjectPreview.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public DigitalObjectPreview(ClientMessages i18n) {
    this.i18n = i18n;
    zoomValues = new ValuesManager();
    zoomValues.setValue(FIELD_ZOOM, Zoom.FIT_PANEL);
    VLayout imgContainer = new VLayout();
    imgContainer.setAlign(Alignment.CENTER);

    windowContainer = new VLayout();
    windowContainer.setAlign(Alignment.CENTER);
    windowContainer.setWidth100();
    windowContainer.setHeight100();
    imageWindow = createFullImageWindow(windowContainer);

    previewLayout = new VLayout();
    previewLayout.setBackgroundColor(BACKGROUND_COLOR);
    previewLayout.addMember(imgContainer);
    previewLoadTask = new ImageLoadTask(imgContainer,
            new Zoom(zoomValues.getValueAsString(FIELD_ZOOM)), false, i18n);
}
 
Example 2
Source File: ImportBatchChooser.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public ImportBatchChooser(ClientMessages i18n) {
    this.i18n = i18n;
    this.actionSource = new ActionSource(this);

    setWidth100();
    setHeight100();

    lGridBatches = initBatchesListGrid();
    lGridBatches.setDataSource(ImportBatchDataSource.getInstance());
    lGridBatches.setShowResizeBar(true);
    lGridBatches.setResizeBarTarget("next");

    ToolStrip toolbar = createToolbar();

    logForm = createLogForm();

    VLayout innerLayout = new VLayout();
    innerLayout.setMargin(4);
    innerLayout.addMember(lGridBatches);
    innerLayout.addMember(logForm);

    setMembers(toolbar, innerLayout);
}
 
Example 3
Source File: DigitalObjectSearchView.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
public DigitalObjectSearchView(ClientMessages i18n, String sourceName) {
    this.i18n = i18n;
    this.i18nSmartGwt = ClientUtils.createSmartGwtMessages();

    foundGrid = createList();
    selectionCache = SelectionCache.selector(foundGrid);
    
    filters = createFilter();

    VLayout vLayout = new VLayout();
    vLayout.addMember(filters);
    toolbar = createToolbar();
    vLayout.addMember(toolbar);
    vLayout.addMember(foundGrid);
    rootWidget = vLayout;
    this.sourceName = sourceName;
}
 
Example 4
Source File: Dialog.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onDraw() {
    super.onDraw();
    VLayout windowContainer = new VLayout();
    windowContainer.setWidth100();
    windowContainer.setMargin(10);
    if (question != null) {
        LayoutSpacer gap = new LayoutSpacer();
        gap.setHeight(30);
        windowContainer.addMember(question);
        windowContainer.addMember(gap);
    }
    windowContainer.addMember(getDialogContentContainer());
    windowContainer.addMember(getDialogButtonsContainer());
    addItem(windowContainer);
}
 
Example 5
Source File: StationSelector.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Canvas createInfoWindow() {
	VLayout layout = new VLayout();
	layout.addMember(createInformationFieldForSelectedStation());
	HLayout buttons = new HLayout();
	buttons.setAutoHeight();
	buttons.setAlign(Alignment.RIGHT);
       buttons.addMember(createApplyCancelCanvas());
       layout.addMember(buttons);

	infoWindow = new InteractionWindow(layout);
	infoWindow.setZIndex(1000000);
	infoWindow.setWidth(300);
	infoWindow.setHeight(300);
	setInfoWindowPosition();
	infoWindow.hide();
	return infoWindow;
}
 
Example 6
Source File: Legend.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
private void createExportMenu() {
    exportMenu = new VLayout();
    exportMenu.setLeft(exportButton.getAbsoluteLeft());
    exportMenu.setTop(30);
    exportMenu.setStyleName("n52_sensorweb_client_interactionmenu");
    exportMenu.setAutoHeight();
    exportMenu.setZIndex(1000000);
    exportMenu.addMember(createPDFLabel());
    exportMenu.addMember(createCSVLabel());
    exportMenu.setVisible(false);
}
 
Example 7
Source File: WorkflowJobView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createMainLayout() {
    VLayout main = new VLayout();
    main.addMember(createPanelLabel());
    // filter
    main.addMember(createFilter());
    // list + item
    main.addMember(createJobLayout());
    return main;
}
 
Example 8
Source File: WorkflowJobFormView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createMainLayout() {
    VLayout main = new VLayout();
    main.addMember(createJobToolbar());
    main.addMember(createForm());
    main.addMember(createTaskList());
    main.addMember(createMaterialList());
    return main;
}
 
Example 9
Source File: UploadFile.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createProgressBar() {
    progressbar.setVertical(false);
    progressbar.setWidth100();
    progressbar.setHeight(24);
    progressbar.setBreadth(1);
    VLayout vLayout = new VLayout();
    vLayout.addMember(progressbar);
    return vLayout;
}
 
Example 10
Source File: UploadFile.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public void showWindow(DigitalObject dobj, BooleanCallback callback) {
    this.dobj = dobj;
    this.windowCallback = callback;
    form.setAutoHeight();

    window = new Window();
    window.setAutoSize(true);
    window.setAutoCenter(true);
    window.setIsModal(true);
    window.setTitle(i18n.DigitalObjectEditor_MediaEditor_Uploader_Title());
    window.setShowMinimizeButton(false);
    window.setShowModalMask(true);
    window.addCloseClickHandler(new CloseClickHandler() {

        @Override
        public void onCloseClick(CloseClickEvent event) {
            closeWindow();
        }
    });

    VLayout winContent = new VLayout(4);
    winContent.setWidth(400);
    winContent.setPadding(5);
    winContent.addMember(createBrowseCanvas());
    winContent.addMember(form);
    winContent.addMember(createProgressBar());
    winContent.addMember(createButtons());
    window.addItem(winContent);

    window.show();
}
 
Example 11
Source File: WorkflowTasksView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createTaskLayout() {
    VLayout left = new VLayout();
    left.addMember(createToolbar());
    left.addMember(createTaskList());
    HLayout l = new HLayout();
    l.addMember(left);
    l.addMember(createTaskFormLayout());
    return l;
}
 
Example 12
Source File: SubscriptionTemplate.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
protected Canvas alignVerticalCenter(Canvas canvasToAlign) {
    VLayout layout = new VLayout();
    layout.addMember(new LayoutSpacer());
    layout.addMember(canvasToAlign);
    layout.addMember(new LayoutSpacer());
    return layout;
}
 
Example 13
Source File: DigitalObjectTreeView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
public DigitalObjectTreeView(ClientMessages i18n) {
    this.i18n = i18n;
    this.i18nSmartGwt = ClientUtils.createSmartGwtMessages();
    treeSelector = createTreeSelector();

    VLayout vLayout = new VLayout();
    toolbar = createToolbar();
    vLayout.addMember(toolbar);
    vLayout.addMember(treeSelector);
    rootWidget = vLayout;
}
 
Example 14
Source File: WorkflowNewJobView.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createMainLayout() {
    VLayout main = new VLayout();
    main.addMember(createPanelLabel());
    main.addMember(createToolbar());
    main.addMember(createOptionForm());
    main.addMember(createCatalogBrowser());
    return main;
}
 
Example 15
Source File: TaskEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private VLayout prepareAutomationPanel() {
	VLayout automationPanel = new VLayout();
	automationPanel.setWidth100();
	automationPanel.setHeight100();

	DynamicForm automationForm = new DynamicForm();
	automationForm.setTitleOrientation(TitleOrientation.TOP);
	automationForm.setNumCols(1);
	automationForm.setValuesManager(vm);

	TextAreaItem onCreation = ItemFactory.newTextAreaItemForAutomation("onCreation",
			state.getType() == GUIWFState.TYPE_TASK ? "execscriptontaskreached" : "execscriptonenstatusreached",
			state.getOnCreation(), null, false);
	onCreation.setWidth("*");
	onCreation.setHeight(200);
	onCreation.setWrapTitle(false);

	TextAreaItem onAssignment = ItemFactory.newTextAreaItemForAutomation("onAssignment",
			"execscriptontaskassignment", state.getOnAssignment(), null, false);
	onAssignment.setWidth("*");
	onAssignment.setHeight(200);
	onAssignment.setWrapTitle(false);

	if (state.getType() == GUIWFState.TYPE_TASK)
		automationForm.setItems(onCreation, onAssignment);
	else {
		onCreation.setHeight(400);
		automationForm.setItems(onCreation);
	}

	automationPanel.addMember(automationForm);

	return automationPanel;
}
 
Example 16
Source File: TasksPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public void init() {
	results.setShowResizeBar(true);
	results.setHeight("60%");
	body.addMember(results);

	detailPanel = new Label(" " + I18N.message("selecttask"));
	details = new VLayout();
	details.setAlign(Alignment.CENTER);
	details.addMember(detailPanel);
	body.addMember(details);

	prepareTasksGrid();

	/*
	 * Create the timer that synchronize the view
	 */
	timer = new Timer() {
		public void run() {
			SystemService.Instance.get().loadTasks(I18N.getLocale(), new AsyncCallback<GUITask[]>() {
				@Override
				public void onFailure(Throwable caught) {
					Log.serverError(caught);
				}

				@Override
				public void onSuccess(GUITask[] tasks) {
					for (GUITask guiTask : tasks) {
						Progressbar p = progresses.get(guiTask.getName());
						if (p == null)
							continue;

						if (guiTask.isIndeterminate()) {
							p.setPercentDone(0);
						} else {
							p.setPercentDone(guiTask.getCompletionPercentage());
						}
						p.redraw();

						for (ListGridRecord record : list.getRecords()) {
							if (record.getAttribute("name").equals(guiTask.getName())
									&& guiTask.getStatus() != GUITask.STATUS_IDLE) {
								record.setAttribute("runningIcon", "running_task");
								record.setAttribute("completion", guiTask.getCompletionPercentage());
								list.refreshRow(list.getRecordIndex(record));
								break;
							} else if (record.getAttribute("name").equals(guiTask.getName())
									&& guiTask.getStatus() == GUITask.STATUS_IDLE) {
								record.setAttribute("runningIcon", "idle_task");
								record.setAttribute("completion", guiTask.getCompletionPercentage());
								list.refreshRow(list.getRecordIndex(record));
								break;
							}
						}
					}
				}
			});
		}
	};

	timer.scheduleRepeating(5 * 1000);
}
 
Example 17
Source File: ImportBatchItemEditor.java    From proarc with GNU General Public License v3.0 4 votes vote down vote up
public ImportBatchItemEditor(ClientMessages i18n) {
        this.i18n = i18n;
        this.setHeight100();
        this.setWidth100();
        this.actionSource = new ActionSource(this);
        
        VLayout layout = new VLayout();
        layout.setShowResizeBar(true);
        layout.setResizeBarTarget("next");

        batchItemGrid = createItemList();
        layout.addMember(batchItemGrid);

        // child editors
        SimpleEventBus eventBus = new SimpleEventBus();
        childPlaces = new PlaceController(eventBus);
        childEditor = new DigitalObjectEditor(i18n, childPlaces, true);
        childDisplay = initDigitalObjectEditor(childEditor, eventBus);
        layout.addMember(childDisplay);

        HLayout editorThumbLayout = new HLayout();
        editorThumbLayout.setHeight100();
        editorThumbLayout.addMember(layout);

        thumbViewer = createThumbViewer();
        editorThumbLayout.addMember(thumbViewer);

        this.selectionCache = new SelectionCache<>(
                Optional.empty(),
                r -> batchItemGrid.getRecordIndex(r));

        VLayout editorThumbToolbarLayout = new VLayout();
        editorThumbToolbarLayout.setShowResizeBar(true);
        editorThumbToolbarLayout.setResizeBarTarget("next");

        createActions();
        ToolStrip editorToolStrip = createEditorToolBar(actionSource);
        editorThumbToolbarLayout.addMember(editorToolStrip);
        editorThumbToolbarLayout.addMember(editorThumbLayout);

        addMember(editorThumbToolbarLayout);

        digitalObjectPreview = new MediaEditor(i18n, MediaEditor.SOURCE_IMPORT_BATCH_ITEM_EDITOR);
        digitalObjectPreview.addBackgroundColorListeners(thumbViewer);
        digitalObjectPreview.setShowRefreshButton(true);
        ToolStrip previewToolbar = Actions.createToolStrip();
        previewToolbar.setMembers(digitalObjectPreview.getToolbarItems());
        VLayout previewLayout = new VLayout();
        previewLayout.setMembers(previewToolbar, digitalObjectPreview.getUI());
        previewLayout.setWidth("40%");
        previewLayout.setHeight100();
//        previewLayout.setShowResizeBar(true);
//        previewLayout.setResizeFrom("L");
        addMember(previewLayout);
        createEditorContextMenu(batchItemGrid.getContextMenu(), this);
        createEditorContextMenu(thumbViewer.getContextMenu(), this);
    }
 
Example 18
Source File: EventSubscriptionWindow.java    From SensorWebClient with GNU General Public License v2.0 4 votes vote down vote up
private Canvas createRuleTemplateEditorCanvas(SubscriptionTemplate template) {
    ruleTemplateEditCanvas = new VLayout();
    ruleTemplateEditCanvas.setStyleName("n52_sensorweb_client_edit_create_abo_edit");
    ruleTemplateEditCanvas.addMember(template.getTemplateContent());
    return ruleTemplateEditCanvas;
}
 
Example 19
Source File: TaskEditor.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
private VLayout prepareMessagesPanel() {
	VLayout messagesPanel = new VLayout();
	messagesPanel.setWidth100();
	messagesPanel.setHeight100();

	DynamicForm messagesForm = new DynamicForm();
	messagesForm.setTitleOrientation(TitleOrientation.TOP);
	messagesForm.setNumCols(2);
	messagesForm.setTitleOrientation(TitleOrientation.LEFT);
	messagesForm.setValuesManager(vm);

	SelectItem creationMessageTemplate = ItemFactory.newSelectItem("creationMessageTemplate",
			state.getType() == GUIWFState.TYPE_TASK ? "messageontaskreached" : "messageonendstatusreached");
	creationMessageTemplate.setWrapTitle(false);

	SelectItem assignmentMessageTemplate = ItemFactory.newSelectItem("assignmentMessageTemplate",
			"messageontaskassignment");
	assignmentMessageTemplate.setWrapTitle(false);

	SelectItem reminderMessageTemplate = ItemFactory.newSelectItem("reminderMessageTemplate", "messageonremind");
	reminderMessageTemplate.setWrapTitle(false);

	if (state.getType() == GUIWFState.TYPE_TASK)
		messagesForm.setItems(creationMessageTemplate, assignmentMessageTemplate, reminderMessageTemplate);
	else
		messagesForm.setItems(creationMessageTemplate);

	messagesPanel.addMember(messagesForm);

	MessageService.Instance.get().loadTemplates(I18N.getLocale(), "user",
			new AsyncCallback<GUIMessageTemplate[]>() {

				@Override
				public void onFailure(Throwable caught) {
					Log.serverError(caught);
				}

				@Override
				public void onSuccess(GUIMessageTemplate[] templates) {
					LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
					map.put("", "");
					for (GUIMessageTemplate t : templates)
						map.put("" + t.getName(), t.getName());

					creationMessageTemplate.setValueMap(map);
					creationMessageTemplate.setValue("");
					creationMessageTemplate.setValue(state.getCreationMessageTemplate());

					assignmentMessageTemplate.setValueMap(map);
					assignmentMessageTemplate.setValue("");
					assignmentMessageTemplate.setValue(state.getAssignmentMessageTemplate());

					reminderMessageTemplate.setValueMap(map);
					reminderMessageTemplate.setValue("");
					reminderMessageTemplate.setValue(state.getReminderMessageTemplate());
				}
			});

	return messagesPanel;
}
 
Example 20
Source File: PersonalSubscriptions.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public PersonalSubscriptions() {
	super();

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("subscriptions"));
	setWidth(400);
	setHeight(350);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	// Initialize the listing panel as placeholder
	listing.setAlign(Alignment.CENTER);
	listing.setHeight100();
	listing.setWidth100();
	initListGrid();

	ToolStrip toolStrip = new ToolStrip();
	toolStrip.setHeight(20);
	toolStrip.setWidth100();
	toolStrip.addSpacer(2);

	ToolStripButton refresh = new ToolStripButton();
	refresh.setTitle(I18N.message("refresh"));
	toolStrip.addButton(refresh);
	refresh.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			initListGrid();
		}
	});
	toolStrip.addFill();

	VLayout layout = new VLayout();
	layout.setMembersMargin(5);
	layout.setMargin(2);
	layout.addMember(toolStrip);
	layout.addMember(listing);

	addItem(layout);
}