/** * Gets the last known height of the browser window in which this UI * resides. * * @return the browser window height in pixels * @deprecated As of 7.0, use the similarly named api in Page instead */ @Deprecated public int getBrowserWindowHeight() { return getPage().getBrowserWindowHeight(); }
/** * Removes a {@link BrowserWindowResizeListener} from this UI. The listener * will no longer be notified when the browser window is resized. * * @param resizeListener * the listener to remove * @deprecated As of 7.0, use the similarly named api in Page instead */ @Deprecated public void removeListener(BrowserWindowResizeListener resizeListener) { getPage().removeBrowserWindowResizeListener(resizeListener); }
/** * Gets the last known width of the browser window in which this UI resides. * * @return the browser window width in pixels * * @deprecated As of 7.0, use the similarly named api in Page instead */ @Deprecated public int getBrowserWindowWidth() { return getPage().getBrowserWindowWidth(); }
/** * Adds a new {@link BrowserWindowResizeListener} to this UI. The listener * will be notified whenever the browser window within which this UI resides * is resized. * * @param resizeListener * the listener to add * * @see BrowserWindowResizeListener#browserWindowResized(com.vaadin.server.Page.BrowserWindowResizeEvent) * BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent) * @see #setResizeLazy(boolean) * * @deprecated As of 7.0, use the similarly named api in Page instead */ @Deprecated public void addListener(BrowserWindowResizeListener resizeListener) { getPage().addBrowserWindowResizeListener(resizeListener); }
/** * Opens the given resource in a window with the given size, border and * name. For more information on the meaning of {@code windowName}, see * {@link #open(Resource, String)}. * <p> * As of Vaadin 7.0.0, the functionality for opening a Resource in a Page * has been replaced with similar methods based on a String URL. This is * because the usage of Resource is problematic with memory management and * with security features in some browsers. Is is recommended to instead use * {@link Link} for starting downloads. * </p> * * @param resource * the resource. * @param windowName * the name of the window. * @param width * the width of the window in pixels * @param height * the height of the window in pixels * @param border * the border style of the window. * @deprecated As of 7.0, use getPage().open instead */ @Deprecated public void open(Resource resource, String windowName, int width, int height, BorderStyle border) { getPage().open(resource, windowName, width, height, border); }
@Override public void setCaption(String caption) { // Override to provide backwards compatibility getState().caption = caption; getPage().setTitle(caption); }
getPage().open(resource, windowName, tryToOpenAsPopup);
/** * Executes JavaScript in this window. * * <p> * This method allows one to inject javascript from the server to client. A * client implementation is not required to implement this functionality, * but currently all web-based clients do implement this. * </p> * * <p> * Executing javascript this way often leads to cross-browser compatibility * issues and regressions that are hard to resolve. Use of this method * should be avoided and instead it is recommended to create new widgets * with GWT. For more info on creating own, reusable client-side widgets in * Java, read the corresponding chapter in Book of Vaadin. * </p> * * @param script * JavaScript snippet that will be executed. * * @deprecated As of 7.0, use JavaScript.getCurrent().execute(String) * instead */ @Deprecated public void executeJavaScript(String script) { getPage().getJavaScript().execute(script); }
public void close() { isRunning = false; Collection<LegacyWindow> windows = getWindows(); for (LegacyWindow legacyWindow : windows) { String logoutUrl = getLogoutURL(); if (logoutUrl == null) { URL url = getURL(); if (url != null) { logoutUrl = url.toString(); } } if (logoutUrl != null) { legacyWindow.getPage().setLocation(logoutUrl); } legacyWindow.close(); } }