diff options
Diffstat (limited to 'server/src/com/vaadin/terminal/Page.java')
-rw-r--r-- | server/src/com/vaadin/terminal/Page.java | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java index 8eb77b7d0d..66ef7da296 100644 --- a/server/src/com/vaadin/terminal/Page.java +++ b/server/src/com/vaadin/terminal/Page.java @@ -25,27 +25,27 @@ import java.util.List; import com.vaadin.event.EventRouter; import com.vaadin.shared.ui.BorderStyle; -import com.vaadin.shared.ui.root.PageClientRpc; -import com.vaadin.shared.ui.root.RootConstants; +import com.vaadin.shared.ui.ui.PageClientRpc; +import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.terminal.WrappedRequest.BrowserDetails; import com.vaadin.terminal.gwt.server.WebApplicationContext; import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.tools.ReflectTools; import com.vaadin.ui.JavaScript; import com.vaadin.ui.Notification; -import com.vaadin.ui.Root; +import com.vaadin.ui.UI; public class Page implements Serializable { /** * Listener that gets notified when the size of the browser window - * containing the root has changed. + * containing the uI has changed. * - * @see Root#addListener(BrowserWindowResizeListener) + * @see UI#addListener(BrowserWindowResizeListener) */ public interface BrowserWindowResizeListener extends Serializable { /** - * Invoked when the browser window containing a Root has been resized. + * Invoked when the browser window containing a UI has been resized. * * @param event * a browser window resize event @@ -54,7 +54,7 @@ public class Page implements Serializable { } /** - * Event that is fired when a browser window containing a root is resized. + * Event that is fired when a browser window containing a uI is resized. */ public class BrowserWindowResizeEvent extends EventObject { @@ -65,7 +65,7 @@ public class Page implements Serializable { * Creates a new event * * @param source - * the root for which the browser window has been resized + * the uI for which the browser window has been resized * @param width * the new width of the browser window * @param height @@ -254,9 +254,9 @@ public class Page implements Serializable { } /** - * Gets the root in which the fragment has changed. + * Gets the uI in which the fragment has changed. * - * @return the root in which the fragment has changed + * @return the uI in which the fragment has changed */ public Page getPage() { return (Page) getSource(); @@ -279,15 +279,15 @@ public class Page implements Serializable { */ private String fragment; - private final Root root; + private final UI uI; private int browserWindowWidth = -1; private int browserWindowHeight = -1; private JavaScript javaScript; - public Page(Root root) { - this.root = root; + public Page(UI uI) { + this.uI = uI; } private void addListener(Class<?> eventType, Object target, Method method) { @@ -332,7 +332,7 @@ public class Page implements Serializable { if (fireEvents) { fireEvent(new FragmentChangedEvent(this, newFragment)); } - root.requestRepaint(); + uI.markAsDirty(); } } @@ -374,7 +374,7 @@ public class Page implements Serializable { } public WebBrowser getWebBrowser() { - return ((WebApplicationContext) root.getApplication().getContext()) + return ((WebApplicationContext) uI.getApplication().getContext()) .getBrowser(); } @@ -399,8 +399,8 @@ public class Page implements Serializable { } /** - * Adds a new {@link BrowserWindowResizeListener} to this root. The listener - * will be notified whenever the browser window within which this root + * 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 @@ -415,7 +415,7 @@ public class Page implements Serializable { } /** - * Removes a {@link BrowserWindowResizeListener} from this root. The + * Removes a {@link BrowserWindowResizeListener} from this uI. The * listener will no longer be notified when the browser window is resized. * * @param resizeListener @@ -427,7 +427,7 @@ public class Page implements Serializable { } /** - * Gets the last known height of the browser window in which this root + * Gets the last known height of the browser window in which this uI * resides. * * @return the browser window height in pixels @@ -437,7 +437,7 @@ public class Page implements Serializable { } /** - * Gets the last known width of the browser window in which this root + * Gets the last known width of the browser window in which this uI * resides. * * @return the browser window width in pixels @@ -450,7 +450,7 @@ public class Page implements Serializable { if (javaScript == null) { // Create and attach on first use javaScript = new JavaScript(); - javaScript.extend(root); + javaScript.extend(uI); } return javaScript; @@ -474,32 +474,32 @@ public class Page implements Serializable { target.startTag("notification"); if (n.getCaption() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_CAPTION, + UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION, n.getCaption()); } if (n.getDescription() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_MESSAGE, + UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE, n.getDescription()); } if (n.getIcon() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_ICON, + UIConstants.ATTRIBUTE_NOTIFICATION_ICON, n.getIcon()); } if (!n.isHtmlContentAllowed()) { target.addAttribute( - RootConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, + UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, true); } target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_POSITION, - n.getPosition()); - target.addAttribute(RootConstants.ATTRIBUTE_NOTIFICATION_DELAY, + UIConstants.ATTRIBUTE_NOTIFICATION_POSITION, n + .getPosition().ordinal()); + target.addAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY, n.getDelayMsec()); if (n.getStyleName() != null) { target.addAttribute( - RootConstants.ATTRIBUTE_NOTIFICATION_STYLE, + UIConstants.ATTRIBUTE_NOTIFICATION_STYLE, n.getStyleName()); } target.endTag("notification"); @@ -509,21 +509,21 @@ public class Page implements Serializable { } if (fragment != null) { - target.addAttribute(RootConstants.FRAGMENT_VARIABLE, fragment); + target.addAttribute(UIConstants.FRAGMENT_VARIABLE, fragment); } } /** - * Opens the given resource in this root. The contents of this Root is + * 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 root + * the resource to show in this uI */ public void open(Resource resource) { openList.add(new OpenResource(resource, null, -1, -1, BORDER_DEFAULT)); - root.requestRepaint(); + uI.markAsDirty(); } /** @@ -566,7 +566,7 @@ public class Page implements Serializable { public void open(Resource resource, String windowName) { openList.add(new OpenResource(resource, windowName, -1, -1, BORDER_DEFAULT)); - root.requestRepaint(); + uI.markAsDirty(); } /** @@ -589,7 +589,7 @@ public class Page implements Serializable { int height, BorderStyle border) { openList.add(new OpenResource(resource, windowName, width, height, border)); - root.requestRepaint(); + uI.markAsDirty(); } /** @@ -603,7 +603,7 @@ public class Page implements Serializable { notifications = new LinkedList<Notification>(); } notifications.add(notification); - root.requestRepaint(); + uI.markAsDirty(); } /** @@ -622,21 +622,21 @@ public class Page implements Serializable { } /** - * Gets the Page to which the current root belongs. This is automatically + * Gets the Page to which the current uI belongs. This is automatically * defined when processing requests to the server. In other cases, (e.g. - * from background threads), the current root is not automatically defined. + * from background threads), the current uI is not automatically defined. * - * @see Root#getCurrent() + * @see UI#getCurrent() * * @return the current page instance if available, otherwise * <code>null</code> */ public static Page getCurrent() { - Root currentRoot = Root.getCurrent(); - if (currentRoot == null) { + UI currentUI = UI.getCurrent(); + if (currentUI == null) { return null; } - return currentRoot.getPage(); + return currentUI.getPage(); } /** @@ -647,7 +647,7 @@ public class Page implements Serializable { * the new page title to set */ public void setTitle(String title) { - root.getRpcProxy(PageClientRpc.class).setTitle(title); + uI.getRpcProxy(PageClientRpc.class).setTitle(title); } } |