Java Code Examples for com.smartgwt.client.widgets.layout.VLayout#setLayoutMargin()
The following examples show how to use
com.smartgwt.client.widgets.layout.VLayout#setLayoutMargin() .
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: ErrorHandler.java From proarc with GNU General Public License v3.0 | 4 votes |
/** * Notifies user about error. * @param msg simple client message * @param detailMsg detail response message; can be HTML * @param debugInfo request details, URL, ... */ private void warn(String msg, String detailMsg, String debugInfo) { if (msg == null) { msg = i18n.ErrorHandler_UnexpectedError_Msg(); } SmartGwtMessages sgi18n = ClientUtils.createSmartGwtMessages(); boolean allowDetail = !msg.equals(detailMsg); final Dialog d = new Dialog(); d.setTitle(sgi18n.dialog_WarnTitle()); d.setIsModal(true); d.setAutoSize(Boolean.FALSE); d.setMessage(msg); d.setIcon("[SKIN]warn.png"); d.setCanDragResize(true); d.setCanDragReposition(Boolean.TRUE); d.setKeepInParentRect(Boolean.TRUE); // d.setShowMaximizeButton(Boolean.TRUE); d.setMinMemberSize(50); Button details = new Button(i18n.ErrorHandler_ButtonDetalis_Title()); details.setVisible(allowDetail); d.setButtons(Dialog.OK, details); if (allowDetail) { Canvas errorPane = new Canvas(); errorPane.setOverflow(Overflow.AUTO); errorPane.setWidth100(); errorPane.setHeight100(); errorPane.setContents(detailMsg); errorPane.setCanSelectText(true); Canvas debugInfoPane = new Canvas(); debugInfoPane.setWidth100(); debugInfoPane.setAutoHeight(); debugInfoPane.setContents(debugInfo); debugInfoPane.setCanSelectText(true); final VLayout detailPane = new VLayout(4); detailPane.setLayoutMargin(4); detailPane.setGroupTitle(i18n.ErrorHandler_ButtonDetalis_Title()); detailPane.setIsGroup(true); detailPane.setVisible(false); detailPane.addMember(errorPane); detailPane.addMember(debugInfoPane); detailPane.setWidth100(); detailPane.setHeight100(); d.addItem(detailPane); details.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { @Override public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) { if (detailPane.isVisible()) { d.restore(); } else { d.maximize(); } detailPane.setVisible(!detailPane.isVisible()); } }); } d.show(); }
Example 2
Source File: ImportSourceChooser.java From proarc with GNU General Public License v3.0 | 4 votes |
public ImportSourceChooser(ClientMessages i18n) { this.i18n = i18n; VLayout layout = this; setWidth100(); setHeight100(); VLayout innerLayout = new VLayout(); innerLayout.setLayoutMargin(4); lblCurrSelection = new Label(i18n.ImportSourceChooser_NothingSelected_Title()); lblCurrSelection.setWidth100(); lblCurrSelection.setAutoFit(true); lblCurrSelection.setMargin(4); lblCurrSelection.setCanSelectText(true); treeGrid = new TreeGrid(); treeGrid.setHeight100(); treeGrid.setDataSource(dataSource); TreeGridField stateField = new TreeGridField( ImportTreeDataSource.FIELD_STATE, i18n.ImportSourceChooser_TreeHeaderImportState_Title()); stateField.setWidth(100); treeGrid.setFields( new TreeGridField(ImportTreeDataSource.FIELD_NAME, i18n.ImportSourceChooser_TreeHeaderFolderName_Title()), stateField); treeGrid.setShowConnectors(true); treeGrid.setEmptyMessage(i18n.ImportSourceChooser_NoDataOnServer_Title()); treeGrid.setAlternateRecordStyles(true); treeGrid.setSelectionType(SelectionStyle.SINGLE); ListGridPersistance treeGridPersistence = new ListGridPersistance("ImportSourceChooser.directoryList", treeGrid); treeGrid.setViewState(treeGridPersistence.getViewState()); treeGrid.addFolderClickHandler(new FolderClickHandler() { @Override public void onFolderClick(FolderClickEvent event) { updateOnSelection(); // issue 41: open node on single click TreeNode folder = event.getFolder(); event.getViewer().getTree().openFolder(folder); } }); ToolStrip toolbar = createToolbar(); optionsForm = createOptionsForm(); innerLayout.setMembers(optionsForm, lblCurrSelection, treeGrid); layout.setMembers(toolbar, innerLayout); }