diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-20 08:53:33 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-20 08:53:33 +0300 |
commit | 890356e6ab17661364a04d60ded9fe01628b0830 (patch) | |
tree | f602189d4f3f47e1026f7327eb4324e89b3c5a9d /server/src/com/vaadin/terminal | |
parent | e69c4908ba61b1fd09f0b50ecbc2e0ec11cd06f5 (diff) | |
download | vaadin-framework-890356e6ab17661364a04d60ded9fe01628b0830.tar.gz vaadin-framework-890356e6ab17661364a04d60ded9fe01628b0830.zip |
Support @Delayable and change window size update to use it (#8421)
Diffstat (limited to 'server/src/com/vaadin/terminal')
3 files changed, 8 insertions, 63 deletions
diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java index d5d474e2e3..933f9b39e6 100644 --- a/server/src/com/vaadin/terminal/Page.java +++ b/server/src/com/vaadin/terminal/Page.java @@ -376,23 +376,17 @@ public class Page implements Serializable { .getBrowser(); } - public void setBrowserWindowSize(Integer width, Integer height) { + public void setBrowserWindowSize(int width, int height) { boolean fireEvent = false; - if (width != null) { - int newWidth = width.intValue(); - if (newWidth != browserWindowWidth) { - browserWindowWidth = newWidth; - fireEvent = true; - } + if (width != browserWindowWidth) { + browserWindowWidth = width; + fireEvent = true; } - if (height != null) { - int newHeight = height.intValue(); - if (newHeight != browserWindowHeight) { - browserWindowHeight = newHeight; - fireEvent = true; - } + if (height != browserWindowHeight) { + browserWindowHeight = height; + fireEvent = true; } if (fireEvent) { diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 00e65382cd..96ae70f27c 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -69,6 +69,7 @@ import com.vaadin.external.json.JSONObject; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.Connector; import com.vaadin.shared.Version; +import com.vaadin.shared.communication.LegacyChangeVariablesInvocation; import com.vaadin.shared.communication.MethodInvocation; import com.vaadin.shared.communication.SharedState; import com.vaadin.shared.communication.UidlValue; diff --git a/server/src/com/vaadin/terminal/gwt/server/LegacyChangeVariablesInvocation.java b/server/src/com/vaadin/terminal/gwt/server/LegacyChangeVariablesInvocation.java deleted file mode 100644 index fc3fbd6c00..0000000000 --- a/server/src/com/vaadin/terminal/gwt/server/LegacyChangeVariablesInvocation.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.terminal.gwt.server; - -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.shared.ApplicationConstants; -import com.vaadin.shared.communication.MethodInvocation; - -public class LegacyChangeVariablesInvocation extends MethodInvocation { - private Map<String, Object> variableChanges = new HashMap<String, Object>(); - - public LegacyChangeVariablesInvocation(String connectorId, - String variableName, Object value) { - super(connectorId, ApplicationConstants.UPDATE_VARIABLE_INTERFACE, - ApplicationConstants.UPDATE_VARIABLE_METHOD); - setVariableChange(variableName, value); - } - - public static boolean isLegacyVariableChange(String interfaceName, - String methodName) { - return ApplicationConstants.UPDATE_VARIABLE_METHOD - .equals(interfaceName) - && ApplicationConstants.UPDATE_VARIABLE_METHOD - .equals(methodName); - } - - public void setVariableChange(String name, Object value) { - variableChanges.put(name, value); - } - - public Map<String, Object> getVariableChanges() { - return variableChanges; - } - -} |