/** * Sets the caption of the message dialog. * * @param caption The caption of the message dialog * @return The {@link MessageBox} instance itself */ public MessageBox withCaption(String caption) { window.setCaption(caption); return this; }
public void buttonClick(ClickEvent event) { window.setContent(oldContent); window.setCaption(oldCaption); window.center(); }
public void afterPropertiesSet() throws Exception { MessageSourceAccessor messageSourceAccessor = new MessageSourceAccessor(m_messageSource); getMainWindow().setCaption(messageSourceAccessor.getMessage("title", null,"title")); for (ViewManaged viewManaged: getInitialLayouts()) { views.put(viewManaged.getClass().getName(), (ComponentContainer)viewManaged); if (isAdjustCaptions()) { I18nCaptionHelper.switchCaptions((Component)viewManaged, messageSourceAccessor); } viewManaged.setViewManager(this); } }
@Override public void start(String title, Component dialog, DialogWidth style) { if (dialog != null) { m_window = CmsBasicDialog.prepareWindow(style); m_window.setCaption(title); m_window.setContent(dialog); UI.getCurrent().addWindow(m_window); if (dialog instanceof CmsBasicDialog) { ((CmsBasicDialog)dialog).initActionHandler(m_window); } } }
/** * @see org.opencms.ui.I_CmsDialogContext#start(java.lang.String, com.vaadin.ui.Component, org.opencms.ui.components.CmsBasicDialog.DialogWidth) */ public void start(String title, Component dialog, DialogWidth width) { if (dialog != null) { m_window = CmsBasicDialog.prepareWindow(width); m_window.setCaption(title); m_window.setContent(dialog); UI.getCurrent().addWindow(m_window); if (dialog instanceof CmsBasicDialog) { ((CmsBasicDialog)dialog).initActionHandler(m_window); } } }
protected void addEntity(String stringInput) { final ET newInstance = instantiateOption(stringInput); if (newInstanceForm != null) { String caption = "Add new " + elementType.getSimpleName(); newInstanceForm.setEntity(newInstance); newInstanceForm.setSavedHandler(this); newInstanceForm.setResetHandler(this); Window w = newInstanceForm.openInModalPopup(); w.setWidth("70%"); w.setCaption(caption); } else { onSave(newInstance); } }
@Override protected void addNewItem(final ClickEvent event) { final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow(); addSoftwareModule.setCaption(i18n.getMessage("caption.create.new", i18n.getMessage("caption.software.module"))); UI.getCurrent().addWindow(addSoftwareModule); addSoftwareModule.setVisible(Boolean.TRUE); }
@Override protected void addNewItem(final ClickEvent event) { final Window addSoftwareModule = softwareModuleAddUpdateWindow.createAddSoftwareModuleWindow(); addSoftwareModule.setCaption(i18n.getMessage("caption.create.new", i18n.getMessage("caption.software.module"))); UI.getCurrent().addWindow(addSoftwareModule); addSoftwareModule.setVisible(Boolean.TRUE); }
public Window buildAndOpen() { Window window = new Window(); window.setCaption(this.title); window.setContent(this.build()); window.center(); window.setModal(this.modal); UI.getCurrent().addWindow(window); return window; } }
@Override protected void addNewItem(final ClickEvent event) { targetAddUpdateWindow.resetComponents(); final Window addTargetWindow = targetAddUpdateWindow.createNewWindow(); addTargetWindow.setCaption(i18n.getMessage("caption.create.new", i18n.getMessage("caption.target"))); UI.getCurrent().addWindow(addTargetWindow); addTargetWindow.setVisible(Boolean.TRUE); }
@Override protected void addNewItem(final ClickEvent event) { targetAddUpdateWindow.resetComponents(); final Window addTargetWindow = targetAddUpdateWindow.createNewWindow(); addTargetWindow.setCaption(i18n.getMessage("caption.create.new", i18n.getMessage("caption.target"))); UI.getCurrent().addWindow(addTargetWindow); addTargetWindow.setVisible(Boolean.TRUE); }
/** * @see org.opencms.ui.I_CmsDialogContext#start(java.lang.String, com.vaadin.ui.Component, org.opencms.ui.components.CmsBasicDialog.DialogWidth) */ public void start(String title, Component dialog, DialogWidth width) { if (dialog != null) { m_window = CmsBasicDialog.prepareWindow(width); m_window.setCaption(title); m_window.setContent(dialog); UI.getCurrent().addWindow(m_window); m_window.addCloseListener(new CloseListener() { private static final long serialVersionUID = 1L; public void windowClose(CloseEvent e) { handleWindowClose(); } }); if (dialog instanceof CmsBasicDialog) { ((CmsBasicDialog)dialog).initActionHandler(m_window); } } }
/** * Replaces the ui content with a single dialog.<p> * * @param caption the caption * @param dialog the dialog content */ public void setContentToDialog(String caption, CmsBasicDialog dialog) { setContent(new Label()); Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow); window.setContent(dialog); window.setCaption(caption); window.setClosable(false); addWindow(window); window.center(); }
/** * @see org.opencms.ui.I_CmsDialogContext#start(java.lang.String, com.vaadin.ui.Component) */ public void start(String title, Component dialog, DialogWidth style) { if (dialog != null) { CmsAppWorkplaceUi.get().disableGlobalShortcuts(); m_window = CmsBasicDialog.prepareWindow(style); m_window.setCaption(title); m_window.setContent(dialog); CmsAppWorkplaceUi.get().addWindow(m_window); if (dialog instanceof CmsBasicDialog) { ((CmsBasicDialog)dialog).initActionHandler(m_window); } } }
/** * @see org.opencms.ui.I_CmsDialogContext#start(java.lang.String, com.vaadin.ui.Component, org.opencms.ui.components.CmsBasicDialog.DialogWidth) */ public void start(String title, Component dialog, DialogWidth width) { if (dialog != null) { m_keepFrameOnClose = false; m_window = CmsBasicDialog.prepareWindow(width); m_window.setCaption(title); m_window.setContent(dialog); UI.getCurrent().addWindow(m_window); m_window.addCloseListener(new CloseListener() { private static final long serialVersionUID = 1L; public void windowClose(CloseEvent e) { handleWindowClose(); } }); if (dialog instanceof CmsBasicDialog) { ((CmsBasicDialog)dialog).initActionHandler(m_window); } } }
@Override protected void onEdit(final ClickEvent event) { final Window addSoftwareModule = softwareModuleAddUpdateWindow .createUpdateSoftwareModuleWindow(getSelectedBaseEntityId()); addSoftwareModule .setCaption(getI18n().getMessage("caption.update", getI18n().getMessage("caption.software.module"))); UI.getCurrent().addWindow(addSoftwareModule); addSoftwareModule.setVisible(Boolean.TRUE); }
@Override protected void onEdit(final ClickEvent event) { final Window addSoftwareModule = softwareModuleAddUpdateWindow .createUpdateSoftwareModuleWindow(getSelectedBaseEntityId()); addSoftwareModule .setCaption(getI18n().getMessage("caption.update", getI18n().getMessage("caption.software.module"))); UI.getCurrent().addWindow(addSoftwareModule); addSoftwareModule.setVisible(Boolean.TRUE); }
private void openWindow() { final Window targetWindow = targetAddUpdateWindowLayout.getWindow(getSelectedBaseEntity().getControllerId()); if (targetWindow == null) { return; } targetWindow.setCaption(getI18n().getMessage("caption.update", getI18n().getMessage("caption.target"))); UI.getCurrent().addWindow(targetWindow); targetWindow.setVisible(Boolean.TRUE); }
private void openWindow() { final Window targetWindow = targetAddUpdateWindowLayout.getWindow(getSelectedBaseEntity().getControllerId()); if (targetWindow == null) { return; } targetWindow.setCaption(getI18n().getMessage("caption.update", getI18n().getMessage("caption.target"))); UI.getCurrent().addWindow(targetWindow); targetWindow.setVisible(Boolean.TRUE); }
/** * Shows the error dialog.<p> * * @param message the error message * @param t the error to be displayed * @param onClose executed on close */ public static void showErrorDialog(String message, Throwable t, Runnable onClose) { Window window = prepareWindow(DialogWidth.wide); window.setCaption(Messages.get().getBundle(A_CmsUI.get().getLocale()).key(Messages.GUI_ERROR_0)); window.setContent(new CmsErrorDialog(message, t, onClose, window)); A_CmsUI.get().addWindow(window); }