private Widget createContent() { BuilderPanel panel = new BuilderPanel(); panel.setSpacing(0); String tooltip = field.getTooltip(); if (tooltip != null) { Label tooltipLabel = new Label(tooltip); tooltipLabel.getElement().getStyle().setMarginBottom(Widgets.defaultSpacing, Unit.PX); panel.add(tooltipLabel); } errorLabel = createErrorLabel(); panel.add(errorLabel); IsWidget header = field.createEditorHeaderWidget(); if (header != null) { panel.add(header); panel.add(Widgets.verticalSpacer()); } editorWidget = field.createEditorWidgetForUse(); panel.add(editorWidget); if (field.isSelfdocEnabled()) { String selfdocKey = field.getSelfdocKey(); panel.add(Widgets.verticalSpacer()); selfdocPanel = Widgets.selfdocPanel(selfdocKey, null, null); panel.add(selfdocPanel); } return Widgets.frame(panel.asWidget()); }
public void submit() { errorLabel.setText(null); Widgets.hide(errorLabel); try { field.submit(); } catch (Exception ex) { log.info(ex); errorLabel.setText(Str.formatException(ex)); Widgets.showAsBlock(errorLabel); return; } Updatable updatable = field.getUpdatable(); if (updatable != null) updatable.update(); field.update(); if (dialog == null) return; dialog.hide(); dialog = null; }
private Widget createFooter() { Button applyButton = new Button(field.getApplyButtonLabel(), new ApplyClickHandler()); applyButton.getElement().setId("applyButton"); applyButton.setStyleName("goon-Button"); applyButton.getElement().getStyle().setMarginTop(Widgets.defaultSpacing, Unit.PX); Button cancelButton = new Button("Abbrechen", new CancelClickHandler()); cancelButton.getElement().setId("cancelButton"); cancelButton.setStyleName("goon-Button"); BuilderPanel buttonRow = new BuilderPanel().setHorizontal().setSpacing(0); buttonRow.setChildTextAlign(TextAlign.RIGHT); buttonRow.add(Widgets.horizontalSpacer()); buttonRow.setChildWidth("1px"); List<? extends IsWidget> additionalButtons = field.getAdditionalDialogButtons(this); buttonRow.addWithPadding(3, new Object[] {cancelButton}); buttonRow.addWithPadding(3, new Object[] {additionalButtons}); buttonRow.addWithPadding(3, new Object[] {applyButton}); return buttonRow.asWidget(); }
private void createDialog() { dialog = Widgets.dialog( field.isEditorDialogAutohide(), field.getLabel(), createContent(), createFooter()); if (selfdocPanel != null) selfdocPanel.setDialog(dialog); }
public void show() { createDialog(); dialog.center(); dialog.show(); Widgets.focusAndSelect(editorWidget); }