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

The following examples show how to use com.smartgwt.client.widgets.layout.VLayout#setMargin() . 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: 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 2
Source File: LoginWindow.java    From proarc with GNU General Public License v3.0 6 votes vote down vote up
private Window createWindow(DynamicForm form) {
    VLayout container = new VLayout();
    container.setMembers(form, createButtons());
    container.setMargin(15);
    Window window = new Window();
    window.setAutoCenter(true);
    window.setAutoSize(true);
    window.setIsModal(true);
    window.addItem(container);
    window.setTitle(i18nSgwt.dialog_LoginTitle());
    window.setShowCloseButton(false);
    window.setShowMinimizeButton(false);
    window.setKeepInParentRect(true);
    window.setShowModalMask(true);
    window.setCanDragReposition(false);
    return window;
}
 
Example 3
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 4
Source File: ZohoEditor.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public ZohoEditor(final GUIDocument document) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("editdoc") + ": " + document.getFileName());

	this.document = document;

	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setAutoSize(true);
	centerInPage();
	setMargin(2);

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			onCancel();
		}
	});

	layout = new VLayout();
	layout.setMargin(1);
	layout.setWidth100();
	layout.setHeight100();
	addItem(layout);

	prepareBody();
}
 
Example 5
Source File: FillForm.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
public FillForm(GUIDocument frm) {
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);

	setTitle(I18N.message("form") + " - " + Util.getBaseName(frm.getFileName()));
	setWidth(500);
	setHeight(400);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	
	IButton save = new IButton();
	save.setTitle(I18N.message("save"));
	save.setAutoFit(true);
	save.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
		@Override
		public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
			onSave();
		}
	});

	HLayout buttonsBar = new HLayout();
	buttonsBar.setWidth100();
	buttonsBar.setHeight(25);
	buttonsBar.setMembers(save);
	
	
	propertiesPanel = new ExtendedPropertiesPanel(frm, null, true, true, false);
	
	VLayout layout = new VLayout();
	layout.setMargin(3);
	layout.setMembersMargin(3);
	layout.setMembers(propertiesPanel, buttonsBar);
	
	addItem(layout);
}
 
Example 6
Source File: LoginPanel.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void prepareSwitchViewLink() {
	String url = "mobile".equals(Util.getJavascriptVariable("j_layout")) ? (Util.contextPath() + "login.jsp")
			: (Util.contextPath() + "login-mobile.jsp");
	url += "?tenant=" + Util.detectTenant();
	String label = "mobile".equals(Util.getJavascriptVariable("j_layout")) ? I18N.message("viewclassicweb")
			: I18N.message("viewmobileweb");

	/*
	 * A link to the alternative login page
	 */
	HTMLFlow switchLink = new HTMLFlow("<a href='" + url + "' class='login-switchview'>" + label + "</a>");
	switchLink.setHeight(16);
	switchLink.setWidth(COLUMN_WIDTH + 20);
	switchLink.setStyleName("login-switchview");

	HLayout spacer10 = new HLayout();
	spacer10.setHeight(10);
	spacer10.setWidth(10);

	VLayout link = new VLayout();
	link.setMembersMargin(0);
	link.setMargin(0);
	link.setStyleName("login-switchview");
	link.setMembers(spacer10, switchLink);
	link.setLayoutAlign(VerticalAlignment.TOP);
	link.setLayoutAlign(Alignment.CENTER);
	link.setWidth(COLUMN_WIDTH + 20);
	link.setHeight(18);

	mainPanel.addMember(link);
}
 
Example 7
Source File: ApplicationRestarting.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private ApplicationRestarting() {
	setHeaderControls(HeaderControls.HEADER_LABEL);
	setTitle(" ");
	setCanDragResize(false);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);
	setShowStatusBar(false);
	setBodyColor("white");
	setMembersMargin(0);

	messageFlow = new HTMLFlow();
	messageFlow.setAlign(Alignment.CENTER);
	messageFlow.setStyleName("contactingserver");
	messageFlow.setLayoutAlign(Alignment.CENTER);
	messageFlow.setLayoutAlign(VerticalAlignment.CENTER);
	messageFlow.setBackgroundColor("white");
	messageFlow.setHeight(50);

	VLayout container = new VLayout();
	container.setWidth100();
	container.setMembersMargin(5);
	container.setMargin(3);
	container.setAlign(Alignment.CENTER);
	container.setDefaultLayoutAlign(Alignment.CENTER);
	container.setMembers(messageFlow);

	addItem(container);
}
 
Example 8
Source File: ContactingServer.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
private ContactingServer() {
	setHeaderControls(HeaderControls.HEADER_LABEL);
	setTitle(" ");
	setCanDragResize(false);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();
	setAutoSize(true);
	setShowStatusBar(false);
	setBodyColor("white");
	setMembersMargin(0);

	HTMLFlow message = new HTMLFlow(AwesomeFactory.getSpinnerIconHtml("pulse", I18N.message("contactingserver")));
	message.setAlign(Alignment.CENTER);
	message.setStyleName("contactingserver");
	message.setLayoutAlign(Alignment.CENTER);
	message.setLayoutAlign(VerticalAlignment.CENTER);
	message.setBackgroundColor("white");
	message.setHeight(50);
	
	
	VLayout container = new VLayout();
	container.setWidth100();
	container.setMembersMargin(5);
	container.setMargin(3);
	container.setAlign(Alignment.CENTER);
	container.setDefaultLayoutAlign(Alignment.CENTER);
	container.setMembers(message);
	
	addItem(container);
}
 
Example 9
Source File: CatalogBrowser.java    From proarc with GNU General Public License v3.0 5 votes vote down vote up
private Canvas createAdvancedOptions() {
        formCatalog = createCatalogForm();

        lgResult = new ListGrid();
        lgResult.setDataSource(BibliographyQueryDataSource.getInstance());
//        lgResult.setUseAllDataSourceFields(true);
        ListGridField preview = new ListGridField(BibliographyQueryDataSource.FIELD_PREVIEW,
                i18n.CatalogBrowser_HeaderPreview_Title());
        ListGridField title = new ListGridField(BibliographyQueryDataSource.FIELD_TITLE,
                i18n.CatalogBrowser_HeaderTitle_Title());
        lgResult.setDetailField(BibliographyQueryDataSource.FIELD_PREVIEW);
        lgResult.setFields(title, preview);
//        lgResult.setAutoFetchData(true);
        lgResult.setHeight100();
        lgResult.setWidth100();
        lgResult.setCanExpandRecords(true);
        lgResult.setCanExpandMultipleRecords(false);
        lgResult.setExpansionMode(ExpansionMode.DETAIL_FIELD);
        lgResult.setSelectionType(SelectionStyle.SINGLE);
//        lgResult.setSelectionAppearance(SelectionAppearance.CHECKBOX);
        lgResult.setAlternateRecordStyles(true);
        lgResult.addDataArrivedHandler(new DataArrivedHandler() {

            @Override
            public void onDataArrived(DataArrivedEvent event) {
                if (event.getStartRow() == 0 && event.getEndRow() > 0) {
                    lgResult.focus();
                    lgResult.selectSingleRecord(0);
                }
            }
        });

        VLayout layout = new VLayout();
        layout.setMembers(formCatalog, lgResult);
        layout.setMargin(4);
        layout.setMembersMargin(4);
        layout.setOverflow(Overflow.AUTO);
        return layout;
    }
 
Example 10
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);
}
 
Example 11
Source File: TaskDetailsDialog.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public TaskDetailsDialog(final WorkflowDashboard dashboard, GUIWorkflow wfl, boolean readOnly) {
	this.workflow = wfl;
	this.workflowDashboard = dashboard;
	this.readOnly = readOnly;

	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);

	setTitle(I18N.message("workflow"));
	setWidth(700);
	setHeight(420);
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	centerInPage();

	addCloseClickHandler(new CloseClickHandler() {
		@Override
		public void onCloseClick(CloseClickEvent event) {
			workflowDashboard.refresh();
			destroy();
		}
	});

	tabs = new TabSet();
	tabs.setWidth100();
	tabs.setHeight100();

	workflowTab = new Tab(I18N.message("workflow"));
	tabs.addTab(workflowTab, 0);

	buttonsPanel = new VLayout();

	mainPanel = new HLayout();
	mainPanel.setMembersMargin(5);
	mainPanel.setMembers(tabs, buttonsPanel);

	addItem(mainPanel);

	form = new HLayout(25);
	form.setMargin(20);
	form.setWidth100();
	form.setHeight100();

	sxLayout = new VLayout(10);
	appendedDocsPanel = new VLayout(5);
	appendedDocsPanel.setMargin(5);
	notesPanel = new VLayout(5);
	notesPanel.setMargin(5);

	reload(wfl);
}
 
Example 12
Source File: ReplaceVersionFile.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
public ReplaceVersionFile(GUIDocument document, String fileVersion) {
	this.document = document;
	this.fileVersion = fileVersion;
	setHeaderControls(HeaderControls.HEADER_LABEL, HeaderControls.CLOSE_BUTTON);
	setTitle(I18N.message("replacefile"));
	setWidth(420);
	
	setCanDragResize(true);
	setIsModal(true);
	setShowModalMask(true);
	setAutoSize(true);
	centerInPage();

	DynamicForm form = new DynamicForm();
	vm = new ValuesManager();
	form.setValuesManager(vm);

	TextItem commentItem = ItemFactory.newTextItem("comment", "comment", null);
	commentItem.setRequired(true);
	commentItem.setWidth(250);

	form.setItems(commentItem);

	// Create a new uploader panel and attach it to the window
	multiUploader = new MultiUploader();
	multiUploader.setStyleName("upload");
	multiUploader.setWidth("300px");
	multiUploader.setHeight("60px");
	multiUploader.setFileInputPrefix("LDOC");
	multiUploader.setMaximumFiles(1);
	multiUploader.addOnFinishUploadHandler(onFinishUploaderHandler);
	multiUploader.reset();

	saveButton = new IButton(I18N.message("save"));
	saveButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {

		@Override
		public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
			onSave();
		}
	});
	saveButton.setDisabled(true);

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

	layout.addMember(form);
	layout.addMember(multiUploader);
	layout.addMember(saveButton);

	addItem(layout);
}
 
Example 13
Source File: LoginPanel.java    From document-management-software with GNU Lesser General Public License v3.0 4 votes vote down vote up
/**
 * Prepares the panel to show messages
 */
protected void prepareAlerts() {
	List<MessageLabel> messages = new ArrayList<MessageLabel>();
	if (info.getAlerts() != null && info.getAlerts().length > 0) {
		for (GUIMessage alert : info.getAlerts()) {
			MessageLabel label = new MessageLabel(alert, info.getTenant().getId() == 1L);
			label.setStyleName("loginMemesage");
			if (alert.isShowInLogin()) {
				messages.add(label);
			}
		}
	}

	if (info.getRunLevel().equals("demo")) {
		GUIMessage demoRunLevelMessage = new GUIMessage();
		demoRunLevelMessage.setMessage(I18N.message("demomode"));
		demoRunLevelMessage.setPriority(GUIMessage.PRIO_INFO);
		MessageLabel demoRunLevel = new MessageLabel(demoRunLevelMessage, info.getTenant().getId() == 1L);
		messages.add(demoRunLevel);
	} else if (info.getRunLevel().equals("updated")) {
		GUIMessage confirmUpdateMessage = new GUIMessage();
		confirmUpdateMessage.setMessage(I18N.message("systemupdatedwarning", info.getRelease()));
		confirmUpdateMessage.setPriority(GUIMessage.PRIO_WARN);
		MessageLabel updatedRunLevel = new MessageLabel(confirmUpdateMessage, info.getTenant().getId() == 1L);
		messages.add(updatedRunLevel);
	}

	HLayout spacer15 = new HLayout();
	spacer15.setHeight(15);
	spacer15.setWidth(15);

	// The messages screen
	VLayout messagesScreen = new VLayout();
	messagesScreen.setMembersMargin(0);
	messagesScreen.setMargin(0);
	messagesScreen.setStyleName("login-screen");
	messagesScreen.setMembers(messages.toArray(new MessageLabel[0]));
	messagesScreen.setLayoutAlign(VerticalAlignment.TOP);
	messagesScreen.setLayoutAlign(Alignment.CENTER);
	messagesScreen.setWidth(COLUMN_WIDTH + 20);
	messagesScreen.setHeight(1);

	mainPanel.addMember(spacer15);

	if (!messages.isEmpty())
		mainPanel.addMember(messagesScreen);
}