diff options
Diffstat (limited to 'server')
9 files changed, 358 insertions, 348 deletions
diff --git a/server/src/com/vaadin/LegacyApplication.java b/server/src/com/vaadin/LegacyApplication.java index 8526bc3310..c28482e2a5 100644 --- a/server/src/com/vaadin/LegacyApplication.java +++ b/server/src/com/vaadin/LegacyApplication.java @@ -27,8 +27,8 @@ import com.vaadin.server.DefaultErrorListener; import com.vaadin.server.Terminal.ErrorEvent; import com.vaadin.server.Terminal.ErrorListener; import com.vaadin.server.VaadinServiceSession; +import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; -import com.vaadin.ui.UI.LegacyWindow; /** * A special application designed to help migrating applications from Vaadin 6 @@ -43,10 +43,10 @@ import com.vaadin.ui.UI.LegacyWindow; */ @Deprecated public abstract class LegacyApplication implements ErrorListener { - private UI.LegacyWindow mainWindow; + private LegacyWindow mainWindow; private String theme; - private Map<String, UI.LegacyWindow> legacyUINames = new HashMap<String, UI.LegacyWindow>(); + private Map<String, LegacyWindow> legacyUINames = new HashMap<String, LegacyWindow>(); private boolean isRunning = true; @@ -64,7 +64,7 @@ public abstract class LegacyApplication implements ErrorListener { * @param mainWindow * the UI to set as the default window */ - public void setMainWindow(UI.LegacyWindow mainWindow) { + public void setMainWindow(LegacyWindow mainWindow) { if (this.mainWindow != null) { throw new IllegalStateException("mainWindow has already been set"); } @@ -102,7 +102,7 @@ public abstract class LegacyApplication implements ErrorListener { * * @return the UI used as the default window */ - public UI.LegacyWindow getMainWindow() { + public LegacyWindow getMainWindow() { return mainWindow; } @@ -145,7 +145,7 @@ public abstract class LegacyApplication implements ErrorListener { * @return a UI corresponding to the name, or <code>null</code> to use the * default window */ - public UI.LegacyWindow getWindow(String name) { + public LegacyWindow getWindow(String name) { return legacyUINames.get(name); } @@ -165,7 +165,7 @@ public abstract class LegacyApplication implements ErrorListener { * * @see #addWindow(UI, String) */ - public void addWindow(UI.LegacyWindow uI) { + public void addWindow(LegacyWindow uI) { if (uI.getName() == null) { String name = Integer.toString(namelessUIIndex++); uI.setName(name); @@ -190,8 +190,8 @@ public abstract class LegacyApplication implements ErrorListener { * @param uI * the UI to remove */ - public void removeWindow(UI.LegacyWindow uI) { - for (Entry<String, UI.LegacyWindow> entry : legacyUINames.entrySet()) { + public void removeWindow(LegacyWindow uI) { + for (Entry<String, LegacyWindow> entry : legacyUINames.entrySet()) { if (entry.getValue() == uI) { legacyUINames.remove(entry.getKey()); } @@ -207,7 +207,7 @@ public abstract class LegacyApplication implements ErrorListener { * * @return the unmodifiable collection of windows. */ - public Collection<UI.LegacyWindow> getWindows() { + public Collection<LegacyWindow> getWindows() { return Collections.unmodifiableCollection(legacyUINames.values()); } diff --git a/server/src/com/vaadin/server/AbstractCommunicationManager.java b/server/src/com/vaadin/server/AbstractCommunicationManager.java index c3a6213265..a294d67a31 100644 --- a/server/src/com/vaadin/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/server/AbstractCommunicationManager.java @@ -82,8 +82,8 @@ import com.vaadin.ui.AbstractField; import com.vaadin.ui.Component; import com.vaadin.ui.ConnectorTracker; import com.vaadin.ui.HasComponents; +import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; -import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; /** diff --git a/server/src/com/vaadin/server/ClassResource.java b/server/src/com/vaadin/server/ClassResource.java index a5b654ea61..29bb0d2a75 100644 --- a/server/src/com/vaadin/server/ClassResource.java +++ b/server/src/com/vaadin/server/ClassResource.java @@ -19,8 +19,8 @@ package com.vaadin.server; import java.io.Serializable; import com.vaadin.service.FileTypeResolver; +import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; -import com.vaadin.ui.UI.LegacyWindow; /** * <code>ClassResource</code> is a named resource accessed with the class diff --git a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java index bedab32105..e2a58ba1bc 100644 --- a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java +++ b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java @@ -22,6 +22,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import com.vaadin.LegacyApplication; +import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; /** @@ -90,7 +91,7 @@ public abstract class LegacyApplicationUIProvider extends UIProvider { if (application == null) { return null; } - UI.LegacyWindow window = application.getWindow(name); + LegacyWindow window = application.getWindow(name); if (window != null) { return window; } diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java index ab8c591b13..2fed002ce6 100644 --- a/server/src/com/vaadin/server/Page.java +++ b/server/src/com/vaadin/server/Page.java @@ -30,10 +30,10 @@ import com.vaadin.shared.ui.BorderStyle; import com.vaadin.shared.ui.ui.PageClientRpc; import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.ui.JavaScript; +import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Link; import com.vaadin.ui.Notification; import com.vaadin.ui.UI; -import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.util.ReflectTools; public class Page implements Serializable { diff --git a/server/src/com/vaadin/ui/LegacyWindow.java b/server/src/com/vaadin/ui/LegacyWindow.java new file mode 100644 index 0000000000..572d3f8490 --- /dev/null +++ b/server/src/com/vaadin/ui/LegacyWindow.java @@ -0,0 +1,341 @@ +/* +@VaadinApache2LicenseForJavaFiles@ +*/ + +package com.vaadin.ui; + +import java.net.MalformedURLException; +import java.net.URL; + +import com.vaadin.LegacyApplication; +import com.vaadin.server.Page; +import com.vaadin.server.Resource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.server.Page.BrowserWindowResizeEvent; +import com.vaadin.server.Page.BrowserWindowResizeListener; +import com.vaadin.shared.ui.BorderStyle; + +/** + * Helper class to emulate the main window from Vaadin 6 using UIs. This + * class should be used in the same way as Window used as a browser level + * window in Vaadin 6 with {@link com.vaadin.LegacyApplication} + */ +@Deprecated +public class LegacyWindow extends UI { + private String name; + private LegacyApplication application; + + /** + * Create a new legacy window + */ + public LegacyWindow() { + super(); + } + + /** + * Creates a new legacy window with the given caption + * + * @param caption + * the caption of the window + */ + public LegacyWindow(String caption) { + super(); + setCaption(caption); + } + + /** + * Creates a legacy window with the given caption and content layout + * + * @param caption + * @param content + */ + public LegacyWindow(String caption, ComponentContainer content) { + super(content); + setCaption(caption); + } + + @Override + protected void init(VaadinRequest request) { + // Just empty + } + + public void setApplication(LegacyApplication application) { + this.application = application; + } + + public LegacyApplication getApplication() { + return application; + } + + /** + * Gets the unique name of the window. The name of the window is used to + * uniquely identify it. + * <p> + * The name also determines the URL that can be used for direct access + * to a window. All windows can be accessed through + * {@code http://host:port/app/win} where {@code http://host:port/app} + * is the application URL (as returned by + * {@link LegacyApplication#getURL()} and {@code win} is the window + * name. + * </p> + * <p> + * Note! Portlets do not support direct window access through URLs. + * </p> + * + * @return the Name of the Window. + */ + public String getName() { + return name; + } + + /** + * Sets the unique name of the window. The name of the window is used to + * uniquely identify it inside the application. + * <p> + * The name also determines the URL that can be used for direct access + * to a window. All windows can be accessed through + * {@code http://host:port/app/win} where {@code http://host:port/app} + * is the application URL (as returned by + * {@link LegacyApplication#getURL()} and {@code win} is the window + * name. + * </p> + * <p> + * This method can only be called before the window is added to an + * application. + * <p> + * Note! Portlets do not support direct window access through URLs. + * </p> + * + * @param name + * the new name for the window or null if the application + * should automatically assign a name to it + * @throws IllegalStateException + * if the window is attached to an application + */ + public void setName(String name) { + this.name = name; + // The name can not be changed in application + if (getSession() != null) { + throw new IllegalStateException( + "Window name can not be changed while " + + "the window is in application"); + } + + } + + /** + * Gets the full URL of the window. The returned URL is window specific + * and can be used to directly refer to the window. + * <p> + * Note! This method can not be used for portlets. + * </p> + * + * @return the URL of the window or null if the window is not attached + * to an application + */ + public URL getURL() { + LegacyApplication application = getApplication(); + if (application == null) { + return null; + } + + try { + return new URL(application.getURL(), getName() + "/"); + } catch (MalformedURLException e) { + throw new RuntimeException( + "Internal problem getting window URL, please report"); + } + } + + /** + * Opens the given resource in this UI. The contents of this UI is + * replaced by the {@code Resource}. + * + * @param resource + * the resource to show in this UI + * + * @deprecated As of 7.0, use getPage().setLocation instead + */ + @Deprecated + public void open(Resource resource) { + open(resource, null); + } + + /* ********************************************************************* */ + + /** + * Opens the given resource in a window with the given name. + * <p> + * The supplied {@code windowName} is used as the target name in a + * window.open call in the client. This means that special values such + * as "_blank", "_self", "_top", "_parent" have special meaning. An + * empty or <code>null</code> window name is also a special case. + * </p> + * <p> + * "", null and "_self" as {@code windowName} all causes the resource to + * be opened in the current window, replacing any old contents. For + * downloadable content you should avoid "_self" as "_self" causes the + * client to skip rendering of any other changes as it considers them + * irrelevant (the page will be replaced by the resource). This can + * speed up the opening of a resource, but it might also put the client + * side into an inconsistent state if the window content is not + * completely replaced e.g., if the resource is downloaded instead of + * displayed in the browser. + * </p> + * <p> + * "_blank" as {@code windowName} causes the resource to always be + * opened in a new window or tab (depends on the browser and browser + * settings). + * </p> + * <p> + * "_top" and "_parent" as {@code windowName} works as specified by the + * HTML standard. + * </p> + * <p> + * Any other {@code windowName} will open the resource in a window with + * that name, either by opening a new window/tab in the browser or by + * replacing the contents of an existing window with that name. + * </p> + * <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. + * @deprecated As of 7.0, use getPage().open instead + */ + @Deprecated + public void open(Resource resource, String windowName) { + open(resource, windowName, -1, -1, Page.BORDER_DEFAULT); + } + + /** + * 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); + } + + /** + * 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(BrowserWindowResizeEvent) + * @see #setResizeLazy(boolean) + * + * @deprecated As of 7.0, use the similarly named api in Page instead + */ + @Deprecated + public void addListener(BrowserWindowResizeListener resizeListener) { + getPage().addListener(resizeListener); + } + + /** + * 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().removeListener(resizeListener); + } + + /** + * 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(); + } + + /** + * 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(); + } + + /** + * 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); + } + + @Override + public void setCaption(String caption) { + // Override to provide backwards compatibility + getState().caption = caption; + getPage().setTitle(caption); + } + +}
\ No newline at end of file diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index d57d38b371..fb6ab9a0e1 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -17,8 +17,6 @@ package com.vaadin.ui; import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -27,7 +25,6 @@ import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Map; -import com.vaadin.LegacyApplication; import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; import com.vaadin.event.ActionManager; @@ -36,11 +33,8 @@ import com.vaadin.event.MouseEvents.ClickListener; import com.vaadin.navigator.Navigator; import com.vaadin.server.LegacyComponent; import com.vaadin.server.Page; -import com.vaadin.server.Page.BrowserWindowResizeEvent; -import com.vaadin.server.Page.BrowserWindowResizeListener; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; -import com.vaadin.server.Resource; import com.vaadin.server.UIProvider; import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinService; @@ -48,7 +42,6 @@ import com.vaadin.server.VaadinServiceSession; import com.vaadin.server.VaadinServlet; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; -import com.vaadin.shared.ui.BorderStyle; import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.shared.ui.ui.UIServerRpc; import com.vaadin.shared.ui.ui.UIState; @@ -91,331 +84,6 @@ public abstract class UI extends AbstractComponentContainer implements Action.Container, Action.Notifier, LegacyComponent { /** - * Helper class to emulate the main window from Vaadin 6 using UIs. This - * class should be used in the same way as Window used as a browser level - * window in Vaadin 6 with {@link com.vaadin.LegacyApplication} - */ - @Deprecated - public static class LegacyWindow extends UI { - private String name; - private LegacyApplication application; - - /** - * Create a new legacy window - */ - public LegacyWindow() { - super(); - } - - /** - * Creates a new legacy window with the given caption - * - * @param caption - * the caption of the window - */ - public LegacyWindow(String caption) { - super(); - setCaption(caption); - } - - /** - * Creates a legacy window with the given caption and content layout - * - * @param caption - * @param content - */ - public LegacyWindow(String caption, ComponentContainer content) { - super(content); - setCaption(caption); - } - - @Override - protected void init(VaadinRequest request) { - // Just empty - } - - public void setApplication(LegacyApplication application) { - this.application = application; - } - - public LegacyApplication getApplication() { - return application; - } - - /** - * Gets the unique name of the window. The name of the window is used to - * uniquely identify it. - * <p> - * The name also determines the URL that can be used for direct access - * to a window. All windows can be accessed through - * {@code http://host:port/app/win} where {@code http://host:port/app} - * is the application URL (as returned by - * {@link LegacyApplication#getURL()} and {@code win} is the window - * name. - * </p> - * <p> - * Note! Portlets do not support direct window access through URLs. - * </p> - * - * @return the Name of the Window. - */ - public String getName() { - return name; - } - - /** - * Sets the unique name of the window. The name of the window is used to - * uniquely identify it inside the application. - * <p> - * The name also determines the URL that can be used for direct access - * to a window. All windows can be accessed through - * {@code http://host:port/app/win} where {@code http://host:port/app} - * is the application URL (as returned by - * {@link LegacyApplication#getURL()} and {@code win} is the window - * name. - * </p> - * <p> - * This method can only be called before the window is added to an - * application. - * <p> - * Note! Portlets do not support direct window access through URLs. - * </p> - * - * @param name - * the new name for the window or null if the application - * should automatically assign a name to it - * @throws IllegalStateException - * if the window is attached to an application - */ - public void setName(String name) { - this.name = name; - // The name can not be changed in application - if (getSession() != null) { - throw new IllegalStateException( - "Window name can not be changed while " - + "the window is in application"); - } - - } - - /** - * Gets the full URL of the window. The returned URL is window specific - * and can be used to directly refer to the window. - * <p> - * Note! This method can not be used for portlets. - * </p> - * - * @return the URL of the window or null if the window is not attached - * to an application - */ - public URL getURL() { - LegacyApplication application = getApplication(); - if (application == null) { - return null; - } - - try { - return new URL(application.getURL(), getName() + "/"); - } catch (MalformedURLException e) { - throw new RuntimeException( - "Internal problem getting window URL, please report"); - } - } - - /** - * Opens the given resource in this UI. The contents of this UI is - * replaced by the {@code Resource}. - * - * @param resource - * the resource to show in this UI - * - * @deprecated As of 7.0, use getPage().setLocation instead - */ - @Deprecated - public void open(Resource resource) { - open(resource, null); - } - - /* ********************************************************************* */ - - /** - * Opens the given resource in a window with the given name. - * <p> - * The supplied {@code windowName} is used as the target name in a - * window.open call in the client. This means that special values such - * as "_blank", "_self", "_top", "_parent" have special meaning. An - * empty or <code>null</code> window name is also a special case. - * </p> - * <p> - * "", null and "_self" as {@code windowName} all causes the resource to - * be opened in the current window, replacing any old contents. For - * downloadable content you should avoid "_self" as "_self" causes the - * client to skip rendering of any other changes as it considers them - * irrelevant (the page will be replaced by the resource). This can - * speed up the opening of a resource, but it might also put the client - * side into an inconsistent state if the window content is not - * completely replaced e.g., if the resource is downloaded instead of - * displayed in the browser. - * </p> - * <p> - * "_blank" as {@code windowName} causes the resource to always be - * opened in a new window or tab (depends on the browser and browser - * settings). - * </p> - * <p> - * "_top" and "_parent" as {@code windowName} works as specified by the - * HTML standard. - * </p> - * <p> - * Any other {@code windowName} will open the resource in a window with - * that name, either by opening a new window/tab in the browser or by - * replacing the contents of an existing window with that name. - * </p> - * <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. - * @deprecated As of 7.0, use getPage().open instead - */ - @Deprecated - public void open(Resource resource, String windowName) { - open(resource, windowName, -1, -1, Page.BORDER_DEFAULT); - } - - /** - * 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); - } - - /** - * 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(BrowserWindowResizeEvent) - * @see #setResizeLazy(boolean) - * - * @deprecated As of 7.0, use the similarly named api in Page instead - */ - @Deprecated - public void addListener(BrowserWindowResizeListener resizeListener) { - getPage().addListener(resizeListener); - } - - /** - * 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().removeListener(resizeListener); - } - - /** - * 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(); - } - - /** - * 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(); - } - - /** - * 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); - } - - @Override - public void setCaption(String caption) { - // Override to provide backwards compatibility - getState().caption = caption; - getPage().setTitle(caption); - } - - } - - /** * Event fired when a UI is removed from the application. */ public static class CleanupEvent extends Event { diff --git a/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java b/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java index 8aac9a9598..0ba1ce0859 100644 --- a/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java +++ b/server/tests/src/com/vaadin/tests/server/component/window/AddRemoveSubWindow.java @@ -8,8 +8,8 @@ import org.junit.Test; import com.vaadin.LegacyApplication; import com.vaadin.server.VaadinServiceSession; +import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.UI; -import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Window; public class AddRemoveSubWindow { diff --git a/server/tests/src/com/vaadin/tests/server/components/TestWindow.java b/server/tests/src/com/vaadin/tests/server/components/TestWindow.java index 12d3a3c8f5..6707965be6 100644 --- a/server/tests/src/com/vaadin/tests/server/components/TestWindow.java +++ b/server/tests/src/com/vaadin/tests/server/components/TestWindow.java @@ -7,7 +7,7 @@ import junit.framework.TestCase; import org.easymock.EasyMock; -import com.vaadin.ui.UI.LegacyWindow; +import com.vaadin.ui.LegacyWindow; import com.vaadin.ui.Window; import com.vaadin.ui.Window.CloseEvent; import com.vaadin.ui.Window.CloseListener; |