Java Code Examples for com.vaadin.ui.Window#setResizable()
The following examples show how to use
com.vaadin.ui.Window#setResizable() .
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: WindowBuilder.java From hawkbit with Eclipse Public License 1.0 | 6 votes |
/** * Build window based on type. * * @return Window */ public Window buildWindow() { final Window window = new Window(caption); window.setContent(content); window.setSizeUndefined(); window.setModal(true); window.setResizable(false); decorateWindow(window); if (SPUIDefinitions.CREATE_UPDATE_WINDOW.equals(type)) { window.setClosable(false); } return window; }
Example 2
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 3
Source File: NotificationUnreadButton.java From hawkbit with Eclipse Public License 1.0 | 5 votes |
private void createNotificationWindow() { notificationsWindow = new Window(); notificationsWindow.setWidth(300.0F, Unit.PIXELS); notificationsWindow.addStyleName(STYLE_POPUP); notificationsWindow.addStyleName(STYLE_NO_CLOSEBOX); notificationsWindow.setClosable(true); notificationsWindow.setResizable(false); notificationsWindow.setDraggable(false); notificationsWindow.setId(UIComponentIdProvider.NOTIFICATION_UNREAD_POPUP_ID); notificationsWindow.addCloseListener(event -> refreshCaption()); notificationsWindow.addBlurListener(this::closeWindow); }
Example 4
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 5
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")); } }
Example 6
Source File: ConfirmationDialog.java From hawkbit with Eclipse Public License 1.0 | 4 votes |
/** * Constructor for configuring confirmation dialog. * * @param caption * the dialog caption. * @param question * the question. * @param okLabel * the Ok button label. * @param cancelLabel * the cancel button label. * @param callback * the callback. * @param icon * the icon of the dialog * @param id * the id of the confirmation dialog * @param tab * ConfirmationTab which contains more information about the action * which has to be confirmed, e.g. maintenance window * @param mapCloseToCancel * Flag indicating whether or not the close event on the enclosing * window should be mapped to a cancel event. */ public ConfirmationDialog(final String caption, final String question, final String okLabel, final String cancelLabel, final ConfirmationDialogCallback callback, final Resource icon, final String id, final ConfirmationTab tab, final boolean mapCloseToCancel) { window = new Window(caption); if (!StringUtils.isEmpty(id)) { window.setId(id); } window.addStyleName(SPUIStyleDefinitions.CONFIRMATION_WINDOW_CAPTION); if (icon != null) { window.setIcon(icon); } okButton = createOkButton(okLabel); final Button cancelButton = createCancelButton(cancelLabel); if (mapCloseToCancel) { window.addCloseListener(e -> { if (!isImplicitClose) { cancelButton.click(); } }); } window.setModal(true); window.addStyleName(SPUIStyleDefinitions.CONFIRMBOX_WINDOW_STYLE); if (this.callback == null) { this.callback = callback; } final VerticalLayout vLayout = new VerticalLayout(); if (question != null) { vLayout.addComponent(createConfirmationQuestion(question)); } if (tab != null) { vLayout.addComponent(tab); } final HorizontalLayout hButtonLayout = createButtonLayout(cancelButton); hButtonLayout.addStyleName("marginTop"); vLayout.addComponent(hButtonLayout); vLayout.setComponentAlignment(hButtonLayout, Alignment.BOTTOM_CENTER); window.setContent(vLayout); window.setResizable(false); }