diff options
author | Artur Signell <artur@vaadin.com> | 2013-04-22 13:52:21 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-04-23 07:45:59 +0000 |
commit | 069e4d2d870fc174df10680275fe7614274edba7 (patch) | |
tree | a6fd42763e636467099074727561f708dd6619d5 /client | |
parent | 0584f4a9a5ec602e421f969dc91029891605dea5 (diff) | |
download | vaadin-framework-069e4d2d870fc174df10680275fe7614274edba7.tar.gz vaadin-framework-069e4d2d870fc174df10680275fe7614274edba7.zip |
Renamed DisplayState to WindowMode (#11662)
Change-Id: I0f70c4195a0871185a1924b008ebd855068e5787
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VWindow.java | 7 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/window/WindowConnector.java | 43 |
2 files changed, 23 insertions, 27 deletions
diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index bd9a0ed07c..138a7f7adc 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -49,7 +49,7 @@ import com.vaadin.client.LayoutManager; import com.vaadin.client.Util; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; import com.vaadin.shared.EventId; -import com.vaadin.shared.ui.window.WindowState.DisplayState; +import com.vaadin.shared.ui.window.WindowMode; /** * "Sub window" component. @@ -571,10 +571,9 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } } - public void updateMaximizeRestoreClassName(boolean visible, - DisplayState state) { + public void updateMaximizeRestoreClassName(boolean visible, WindowMode windowMode) { String className; - if (state == DisplayState.MAXIMIZED) { + if (windowMode == WindowMode.MAXIMIZED) { className = CLASSNAME + "-restorebox"; } else { className = CLASSNAME + "-maximizebox"; diff --git a/client/src/com/vaadin/client/ui/window/WindowConnector.java b/client/src/com/vaadin/client/ui/window/WindowConnector.java index 66907fbfa4..f1ea99f3f5 100644 --- a/client/src/com/vaadin/client/ui/window/WindowConnector.java +++ b/client/src/com/vaadin/client/ui/window/WindowConnector.java @@ -45,9 +45,9 @@ import com.vaadin.client.ui.VWindow; import com.vaadin.client.ui.layout.MayScrollChildren; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.Connect; +import com.vaadin.shared.ui.window.WindowMode; import com.vaadin.shared.ui.window.WindowServerRpc; import com.vaadin.shared.ui.window.WindowState; -import com.vaadin.shared.ui.window.WindowState.DisplayState; @Connect(value = com.vaadin.ui.Window.class) public class WindowConnector extends AbstractSingleComponentContainerConnector @@ -245,8 +245,7 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector @Override public void postLayout() { VWindow window = getWidget(); - if (window.centered - && getState().displayState != DisplayState.MAXIMIZED) { + if (window.centered && getState().windowMode != WindowMode.MAXIMIZED) { window.center(); } window.positionOrSizeUpdated(); @@ -272,16 +271,15 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector window.show(); } boolean resizeable = state.resizable - && state.displayState == DisplayState.NORMAL; + && state.windowMode == WindowMode.NORMAL; window.setResizable(resizeable); window.resizeLazy = state.resizeLazy; window.setDraggable(state.draggable - && state.displayState == DisplayState.NORMAL); + && state.windowMode == WindowMode.NORMAL); - window.updateMaximizeRestoreClassName(state.resizable, - state.displayState); + window.updateMaximizeRestoreClassName(state.resizable, state.windowMode); // Caption must be set before required header size is measured. If // the caption attribute is missing the caption should be cleared. @@ -320,12 +318,12 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector } } - // Need to override default because of DisplayState + // Need to override default because of window mode @Override protected void updateComponentSize() { - if (getState().displayState == DisplayState.NORMAL) { + if (getState().windowMode == WindowMode.NORMAL) { super.updateComponentSize(); - } else if (getState().displayState == DisplayState.MAXIMIZED) { + } else if (getState().windowMode == WindowMode.MAXIMIZED) { super.updateComponentSize("100%", "100%"); } } @@ -333,45 +331,44 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector protected void updateWindowPosition() { VWindow window = getWidget(); WindowState state = getState(); - if (state.displayState == DisplayState.NORMAL) { + if (state.windowMode == WindowMode.NORMAL) { // if centered, position handled in postLayout() if (!state.centered) { window.setPopupPosition(state.positionX, state.positionY); } - } else if (state.displayState == DisplayState.MAXIMIZED) { + } else if (state.windowMode == WindowMode.MAXIMIZED) { window.setPopupPositionNoUpdate(0, 0); window.bringToFront(); } } - protected void updateDisplayState() { + protected void updateWindowMode() { VWindow window = getWidget(); WindowState state = getState(); // update draggable on widget window.setDraggable(state.draggable - && state.displayState == DisplayState.NORMAL); + && state.windowMode == WindowMode.NORMAL); // update resizable on widget window.setResizable(state.resizable - && state.displayState == DisplayState.NORMAL); + && state.windowMode == WindowMode.NORMAL); updateComponentSize(); updateWindowPosition(); - window.updateMaximizeRestoreClassName(state.resizable, - state.displayState); + window.updateMaximizeRestoreClassName(state.resizable, state.windowMode); window.updateContentsSize(); } protected void onMaximizeRestore() { WindowState state = getState(); if (state.resizable) { - if (state.displayState == DisplayState.MAXIMIZED) { - state.displayState = DisplayState.NORMAL; + if (state.windowMode == WindowMode.MAXIMIZED) { + state.windowMode = WindowMode.NORMAL; } else { - state.displayState = DisplayState.MAXIMIZED; + state.windowMode = WindowMode.MAXIMIZED; } - updateDisplayState(); - getRpcProxy(WindowServerRpc.class).windowDisplayStateChanged( - state.displayState); + updateWindowMode(); + getRpcProxy(WindowServerRpc.class).windowModeChanged( + state.windowMode); } } |