Java Code Examples for com.vaadin.ui.Window#setCaption()
The following examples show how to use
com.vaadin.ui.Window#setCaption() .
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: TargetTableHeader.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
@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); }
Example 2
Source File: TargetDetails.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
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); }
Example 3
Source File: SwModuleDetails.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private void showArtifactDetailsWindow(final SoftwareModule softwareModule) { final Window artifactDtlsWindow = new Window(); artifactDtlsWindow.setId(UIComponentIdProvider.SHOW_ARTIFACT_DETAILS_POPUP_ID); artifactDtlsWindow.setAssistivePrefix(HawkbitCommonUtil .getArtifactoryDetailsLabelId(softwareModule.getName(), getI18n()) + " " + "<b>"); artifactDtlsWindow.setCaption(softwareModule.getName() + ":" + softwareModule.getVersion()); artifactDtlsWindow.setAssistivePostfix("</b>"); artifactDtlsWindow.setClosable(true); artifactDtlsWindow.setResizable(true); artifactDtlsWindow.setImmediate(true); artifactDtlsWindow.setWindowMode(WindowMode.NORMAL); artifactDtlsWindow.setModal(true); artifactDtlsWindow.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION); artifactDetailsLayout.setFullWindowMode(false); artifactDetailsLayout.populateArtifactDetails(softwareModule); artifactDetailsLayout.getArtifactDetailsTable().setWidth(700, Unit.PIXELS); artifactDetailsLayout.getArtifactDetailsTable().setHeight(500, Unit.PIXELS); artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable()); artifactDtlsWindow.addWindowModeChangeListener(event -> { if (event.getWindowMode() == WindowMode.MAXIMIZED) { artifactDtlsWindow.setSizeFull(); artifactDetailsLayout.setFullWindowMode(true); artifactDetailsLayout.createMaxArtifactDetailsTable(); artifactDetailsLayout.getMaxArtifactDetailsTable().setWidth(100, Unit.PERCENTAGE); artifactDetailsLayout.getMaxArtifactDetailsTable().setHeight(100, Unit.PERCENTAGE); artifactDtlsWindow.setContent(artifactDetailsLayout.getMaxArtifactDetailsTable()); } else { artifactDtlsWindow.setSizeUndefined(); artifactDtlsWindow.setContent(artifactDetailsLayout.getArtifactDetailsTable()); } }); UI.getCurrent().addWindow(artifactDtlsWindow); }
Example 4
Source File: AbstractSoftwareModuleDetails.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
@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); }
Example 5
Source File: AbstractSoftwareModuleTableHeader.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
@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); }
Example 6
Source File: SubSetSelector.java From viritin with Apache License 2.0 | 5 votes |
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); } }
Example 7
Source File: MismatchedUserSessionHandler.java From cuba with Apache License 2.0 | 4 votes |
protected void showMismatchedSessionDialog(AppUI ui) { Messages messages = beanLocator.get(Messages.class); Connection connection = ui.getApp().getConnection(); //noinspection ConstantConditions Locale locale = connection.getSession().getLocale(); Window dialog = new MismatchedUserSessionExceptionDialog(); dialog.setStyleName("c-sessionchanged-dialog"); dialog.setCaption(messages.getMainMessage("dialogs.Information", locale)); dialog.setClosable(false); dialog.setResizable(false); dialog.setModal(true); CubaLabel messageLab = new CubaLabel(); messageLab.setWidthUndefined(); messageLab.setValue(messages.getMainMessage("sessionChangedMsg", locale)); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(false); layout.setWidthUndefined(); layout.setStyleName("c-sessionchanged-dialog-layout"); layout.setSpacing(true); dialog.setContent(layout); CubaButton reloginBtn = new CubaButton(); reloginBtn.addStyleName(WebButton.PRIMARY_ACTION_STYLENAME); reloginBtn.setCaption(messages.getMainMessage(DialogAction.Type.OK.getMsgKey(), locale)); reloginBtn.addClickListener(event -> ui.getApp().recreateUi(ui)); String iconName = beanLocator.get(Icons.class) .get(DialogAction.Type.OK.getIconKey()); reloginBtn.setIcon(beanLocator.get(IconResolver.class) .getIconResource(iconName)); ClientConfig clientConfig = beanLocator.get(Configuration.class) .getConfig(ClientConfig.class); setClickShortcut(reloginBtn, clientConfig.getCommitShortcut()); reloginBtn.focus(); layout.addComponent(messageLab); layout.addComponent(reloginBtn); layout.setComponentAlignment(reloginBtn, Alignment.BOTTOM_RIGHT); ui.addWindow(dialog); dialog.center(); if (ui.isTestMode()) { dialog.setCubaId("optionDialog"); reloginBtn.setCubaId("reloginBtn"); } if (ui.isPerformanceTestMode()) { dialog.setId(ui.getTestIdManager().getTestId("optionDialog")); reloginBtn.setId(ui.getTestIdManager().getTestId("reloginBtn")); } }
Example 8
Source File: NoUserSessionHandler.java From cuba with Apache License 2.0 | 4 votes |
protected void showNoUserSessionDialog(AppUI ui) { Messages messages = beanLocator.get(Messages.class); Connection connection = ui.getApp().getConnection(); //noinspection ConstantConditions Locale locale = connection.getSession().getLocale(); Window dialog = new NoUserSessionExceptionDialog(); dialog.setStyleName("c-nousersession-dialog"); dialog.setCaption(messages.getMainMessage("dialogs.Information", locale)); dialog.setClosable(false); dialog.setResizable(false); dialog.setModal(true); CubaLabel messageLab = new CubaLabel(); messageLab.setWidthUndefined(); messageLab.setValue(messages.getMainMessage("noUserSession.message", locale)); VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(false); layout.setWidthUndefined(); layout.setStyleName("c-nousersession-dialog-layout"); layout.setSpacing(true); dialog.setContent(layout); CubaButton reloginBtn = new CubaButton(); reloginBtn.addStyleName(WebButton.PRIMARY_ACTION_STYLENAME); reloginBtn.addClickListener(event -> relogin()); reloginBtn.setCaption(messages.getMainMessage(Type.OK.getMsgKey())); String iconName = beanLocator.get(Icons.class) .get(Type.OK.getIconKey()); reloginBtn.setIcon(beanLocator.get(IconResolver.class) .getIconResource(iconName)); ClientConfig clientConfig = beanLocator.get(Configuration.class) .getConfig(ClientConfig.class); setClickShortcut(reloginBtn, clientConfig.getCommitShortcut()); reloginBtn.focus(); layout.addComponent(messageLab); layout.addComponent(reloginBtn); layout.setComponentAlignment(reloginBtn, Alignment.BOTTOM_RIGHT); ui.addWindow(dialog); dialog.center(); if (ui.isTestMode()) { dialog.setCubaId("optionDialog"); reloginBtn.setCubaId("reloginBtn"); } if (ui.isPerformanceTestMode()) { dialog.setId(ui.getTestIdManager().getTestId("optionDialog")); reloginBtn.setId(ui.getTestIdManager().getTestId("reloginBtn")); } }