List of usage examples for com.vaadin.ui Window addWindowModeChangeListener
public Registration addWindowModeChangeListener(WindowModeChangeListener listener)
From source file:com.cms.utils.DataUtil.java
License:Open Source License
public static void reloadWindow(Window subWindow) { subWindow.addWindowModeChangeListener(new Window.WindowModeChangeListener() { @Override// ww w . j a va 2 s. c om public void windowModeChanged(Window.WindowModeChangeEvent event) { try { Thread.sleep(500L); } catch (InterruptedException ex) { Logger.getLogger(DataUtil.class.getName()).log(Level.SEVERE, null, ex); } } }); }
From source file:com.dungnv.utils.FWUtils.java
public static void reloadWindow(Window subWindow) { subWindow.addWindowModeChangeListener((Window.WindowModeChangeEvent event) -> { try {/*from w w w . j a va 2s.co m*/ Thread.sleep(500L); } catch (InterruptedException ex) { Logger.getLogger(FWUtils.class.getName()).log(Level.SEVERE, null, ex); } }); }
From source file:org.eclipse.hawkbit.ui.distributions.smtable.SwModuleDetails.java
License:Open Source License
private void showArtifactDetailsWindow(final SoftwareModule softwareModule) { final Window artifactDtlsWindow = new Window(); artifactDtlsWindow.setCaption(HawkbitCommonUtil.getArtifactoryDetailsLabelId( softwareModule.getName() + "." + softwareModule.getVersion(), getI18n())); artifactDtlsWindow.setCaptionAsHtml(true); artifactDtlsWindow.setClosable(true); artifactDtlsWindow.setResizable(true); artifactDtlsWindow.setImmediate(true); artifactDtlsWindow.setWindowMode(WindowMode.NORMAL); artifactDtlsWindow.setModal(true);//from w w w . j ava 2s . c o m 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); }