summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2012-08-27 12:40:41 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2012-08-27 12:40:41 +0300
commita67ca492c18451c0f286e90b3a5fb34bde2d3c47 (patch)
tree77f8879242385bfa6f970bfb129531dd32ce242a /shared
parentc8cee295021dcd33982217e3ad1c374bfca63a29 (diff)
parentfc3f7f62b05ae69b242d64084f676d7733962c60 (diff)
downloadvaadin-framework-a67ca492c18451c0f286e90b3a5fb34bde2d3c47.tar.gz
vaadin-framework-a67ca492c18451c0f286e90b3a5fb34bde2d3c47.zip
Merge branch 'master' into root-cleanup
Rename Root -> UI in root cleanup code Conflicts: client/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java server/src/com/vaadin/ui/UI.java
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ApplicationConstants.java4
-rw-r--r--shared/src/com/vaadin/shared/Connector.java11
-rwxr-xr-xshared/src/com/vaadin/shared/Position.java20
-rw-r--r--shared/src/com/vaadin/shared/annotations/DelegateToWidget.java25
-rw-r--r--shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java27
-rw-r--r--shared/src/com/vaadin/shared/ui/AbstractMediaState.java4
-rw-r--r--shared/src/com/vaadin/shared/ui/embeddedbrowser/EmbeddedBrowserState.java7
-rw-r--r--shared/src/com/vaadin/shared/ui/flash/FlashState.java68
-rw-r--r--shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java8
-rw-r--r--shared/src/com/vaadin/shared/ui/image/ImageState.java7
-rw-r--r--shared/src/com/vaadin/shared/ui/label/LabelState.java21
-rw-r--r--shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java2
-rw-r--r--shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java5
-rw-r--r--shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java14
-rw-r--r--shared/src/com/vaadin/shared/ui/slider/SliderState.java60
-rw-r--r--shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java3
-rw-r--r--shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java3
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java (renamed from shared/src/com/vaadin/shared/ui/root/PageClientRpc.java)2
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/UIConstants.java (renamed from shared/src/com/vaadin/shared/ui/root/RootConstants.java)9
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java (renamed from shared/src/com/vaadin/shared/ui/root/RootServerRpc.java)4
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/UIState.java (renamed from shared/src/com/vaadin/shared/ui/root/RootState.java)4
21 files changed, 266 insertions, 42 deletions
diff --git a/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java
index 9d1ed7341d..0bacd2d256 100644
--- a/shared/src/com/vaadin/shared/ApplicationConstants.java
+++ b/shared/src/com/vaadin/shared/ApplicationConstants.java
@@ -31,10 +31,6 @@ public class ApplicationConstants {
public static final String APP_PROTOCOL_PREFIX = "app://";
public static final String CONNECTOR_PROTOCOL_PREFIX = "connector://";
public static final String UIDL_SECURITY_TOKEN_ID = "Vaadin-Security-Key";
- /**
- * Name of the parameter used to transmit root ids back and forth
- */
- public static final String ROOT_ID_PARAMETER = "rootId";
public static final String PARAM_UNLOADBURST = "onunloadburst";
diff --git a/shared/src/com/vaadin/shared/Connector.java b/shared/src/com/vaadin/shared/Connector.java
index 5a00f6cca2..5927d08d79 100644
--- a/shared/src/com/vaadin/shared/Connector.java
+++ b/shared/src/com/vaadin/shared/Connector.java
@@ -17,8 +17,6 @@ package com.vaadin.shared;
import java.io.Serializable;
-import com.vaadin.shared.communication.SharedState;
-
/**
* Interface implemented by all classes that are capable of communicating with
* the server or the client side.
@@ -41,15 +39,6 @@ import com.vaadin.shared.communication.SharedState;
*/
public interface Connector extends Serializable {
/**
- * Gets the current shared state of the connector.
- *
- * @since 7.0.
- * @return state The shared state object. Can be any sub type of
- * {@link SharedState}. Never null.
- */
- public SharedState getState();
-
- /**
* Returns the id for this connector. This is set by the framework and does
* not change during the lifetime of a connector.
*
diff --git a/shared/src/com/vaadin/shared/Position.java b/shared/src/com/vaadin/shared/Position.java
new file mode 100755
index 0000000000..89d6a4261c
--- /dev/null
+++ b/shared/src/com/vaadin/shared/Position.java
@@ -0,0 +1,20 @@
+/*
+ * 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.shared;
+
+public enum Position {
+ TOP_LEFT, TOP_CENTER, TOP_RIGHT, MIDDLE_LEFT, MIDDLE_CENTER, MIDDLE_RIGHT, BOTTOM_LEFT, BOTTOM_CENTER, BOTTOM_RIGHT;
+}
diff --git a/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java b/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java
new file mode 100644
index 0000000000..0ac16ecea9
--- /dev/null
+++ b/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java
@@ -0,0 +1,25 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.shared.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.METHOD, ElementType.FIELD })
+public @interface DelegateToWidget {
+ public String value() default "";
+
+ public static class Helper {
+ public static String getDelegateTarget(String propertyName,
+ String annotationValue) {
+ String name = annotationValue;
+ if (name.isEmpty()) {
+ name = "set" + Character.toUpperCase(propertyName.charAt(0))
+ + propertyName.substring(1);
+ }
+ return name;
+ }
+ }
+}
diff --git a/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java
new file mode 100644
index 0000000000..96b785edd0
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java
@@ -0,0 +1,27 @@
+package com.vaadin.shared.ui;
+
+import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.communication.URLReference;
+
+public class AbstractEmbeddedState extends ComponentState {
+
+ protected URLReference source;
+ protected String alternateText;
+
+ public URLReference getSource() {
+ return source;
+ }
+
+ public void setSource(URLReference source) {
+ this.source = source;
+ }
+
+ public String getAlternateText() {
+ return alternateText;
+ }
+
+ public void setAlternateText(String alternateText) {
+ this.alternateText = alternateText;
+ }
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java
index 2731529caf..80d41dd797 100644
--- a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java
+++ b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java
@@ -19,6 +19,7 @@ import java.util.ArrayList;
import java.util.List;
import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.annotations.DelegateToWidget;
import com.vaadin.shared.communication.URLReference;
public class AbstractMediaState extends ComponentState {
@@ -39,6 +40,7 @@ public class AbstractMediaState extends ComponentState {
return showControls;
}
+ @DelegateToWidget("setControls")
public void setShowControls(boolean showControls) {
this.showControls = showControls;
}
@@ -63,6 +65,7 @@ public class AbstractMediaState extends ComponentState {
return autoplay;
}
+ @DelegateToWidget
public void setAutoplay(boolean autoplay) {
this.autoplay = autoplay;
}
@@ -71,6 +74,7 @@ public class AbstractMediaState extends ComponentState {
return muted;
}
+ @DelegateToWidget
public void setMuted(boolean muted) {
this.muted = muted;
}
diff --git a/shared/src/com/vaadin/shared/ui/embeddedbrowser/EmbeddedBrowserState.java b/shared/src/com/vaadin/shared/ui/embeddedbrowser/EmbeddedBrowserState.java
new file mode 100644
index 0000000000..cca47176a3
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/embeddedbrowser/EmbeddedBrowserState.java
@@ -0,0 +1,7 @@
+package com.vaadin.shared.ui.embeddedbrowser;
+
+import com.vaadin.shared.ui.AbstractEmbeddedState;
+
+public class EmbeddedBrowserState extends AbstractEmbeddedState {
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/flash/FlashState.java b/shared/src/com/vaadin/shared/ui/flash/FlashState.java
new file mode 100644
index 0000000000..2d33d1a711
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/flash/FlashState.java
@@ -0,0 +1,68 @@
+package com.vaadin.shared.ui.flash;
+
+import java.util.Map;
+
+import com.vaadin.shared.ui.AbstractEmbeddedState;
+
+public class FlashState extends AbstractEmbeddedState {
+
+ protected String classId;
+
+ protected String codebase;
+
+ protected String codetype;
+
+ protected String archive;
+
+ protected String standby;
+
+ protected Map<String, String> embedParams;
+
+ public String getClassId() {
+ return classId;
+ }
+
+ public void setClassId(String classId) {
+ this.classId = classId;
+ }
+
+ public String getCodebase() {
+ return codebase;
+ }
+
+ public void setCodebase(String codeBase) {
+ codebase = codebase;
+ }
+
+ public String getCodetype() {
+ return codetype;
+ }
+
+ public void setCodetype(String codetype) {
+ this.codetype = codetype;
+ }
+
+ public String getArchive() {
+ return archive;
+ }
+
+ public void setArchive(String archive) {
+ this.archive = archive;
+ }
+
+ public String getStandby() {
+ return standby;
+ }
+
+ public void setStandby(String standby) {
+ this.standby = standby;
+ }
+
+ public Map<String, String> getEmbedParams() {
+ return embedParams;
+ }
+
+ public void setEmbedParams(Map<String, String> embedParams) {
+ this.embedParams = embedParams;
+ }
+}
diff --git a/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java b/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java
new file mode 100644
index 0000000000..aa48f10e5b
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java
@@ -0,0 +1,8 @@
+package com.vaadin.shared.ui.image;
+
+import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.shared.ui.ClickRpc;
+
+public interface ImageServerRpc extends ClickRpc, ServerRpc {
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/image/ImageState.java b/shared/src/com/vaadin/shared/ui/image/ImageState.java
new file mode 100644
index 0000000000..4296c76847
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/image/ImageState.java
@@ -0,0 +1,7 @@
+package com.vaadin.shared.ui.image;
+
+import com.vaadin.shared.ui.AbstractEmbeddedState;
+
+public class ImageState extends AbstractEmbeddedState {
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/label/LabelState.java b/shared/src/com/vaadin/shared/ui/label/LabelState.java
index 35e27bc63d..a91aeb0aa1 100644
--- a/shared/src/com/vaadin/shared/ui/label/LabelState.java
+++ b/shared/src/com/vaadin/shared/ui/label/LabelState.java
@@ -18,23 +18,6 @@ package com.vaadin.shared.ui.label;
import com.vaadin.shared.ComponentState;
public class LabelState extends ComponentState {
- private ContentMode contentMode = ContentMode.TEXT;
- private String text = "";
-
- public ContentMode getContentMode() {
- return contentMode;
- }
-
- public void setContentMode(ContentMode contentMode) {
- this.contentMode = contentMode;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
+ public ContentMode contentMode = ContentMode.TEXT;
+ public String text = "";
}
diff --git a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java
index 3fa2ad771c..35456ab9ac 100644
--- a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java
+++ b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java
@@ -25,7 +25,7 @@ import com.vaadin.shared.ui.AlignmentInfo;
public class AbstractOrderedLayoutState extends AbstractLayoutState {
private boolean spacing = false;
- public HashMap<Connector, ChildComponentData> childData = new HashMap<Connector, ChildComponentData>();
+ private HashMap<Connector, ChildComponentData> childData = new HashMap<Connector, ChildComponentData>();
private int marginsBitmask = 0;
diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java
new file mode 100644
index 0000000000..d130550946
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java
@@ -0,0 +1,5 @@
+package com.vaadin.shared.ui.slider;
+
+public enum SliderOrientation {
+ HORIZONTAL, VERTICAL;
+}
diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java
new file mode 100644
index 0000000000..6ea02f0a95
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java
@@ -0,0 +1,14 @@
+package com.vaadin.shared.ui.slider;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+public interface SliderServerRpc extends ServerRpc {
+
+ /**
+ * Invoked when the value of a variable has changed. Slider listeners are
+ * notified if the slider value has changed.
+ *
+ * @param value
+ */
+ public void valueChanged(double value);
+}
diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderState.java b/shared/src/com/vaadin/shared/ui/slider/SliderState.java
new file mode 100644
index 0000000000..98168b80af
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/slider/SliderState.java
@@ -0,0 +1,60 @@
+package com.vaadin.shared.ui.slider;
+
+import com.vaadin.shared.AbstractFieldState;
+
+public class SliderState extends AbstractFieldState {
+
+ protected double value;
+
+ protected double maxValue;
+ protected double minValue;
+
+ /**
+ * The number of fractional digits that are considered significant. Must be
+ * non-negative.
+ */
+ protected int resolution;
+
+ protected SliderOrientation orientation;
+
+ public double getValue() {
+ return value;
+ }
+
+ public void setValue(double value) {
+ this.value = value;
+ }
+
+ public double getMaxValue() {
+ return maxValue;
+ }
+
+ public void setMaxValue(double maxValue) {
+ this.maxValue = maxValue;
+ }
+
+ public double getMinValue() {
+ return minValue;
+ }
+
+ public void setMinValue(double minValue) {
+ this.minValue = minValue;
+ }
+
+ public int getResolution() {
+ return resolution;
+ }
+
+ public void setResolution(int resolution) {
+ this.resolution = resolution;
+ }
+
+ public SliderOrientation getOrientation() {
+ return orientation;
+ }
+
+ public void setOrientation(SliderOrientation orientation) {
+ this.orientation = orientation;
+ }
+
+}
diff --git a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java
index 46eb851edd..71f789b70d 100644
--- a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java
+++ b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java
@@ -19,6 +19,7 @@ import java.io.Serializable;
import com.vaadin.shared.ComponentState;
import com.vaadin.shared.Connector;
+import com.vaadin.shared.annotations.DelegateToWidget;
public class AbstractSplitPanelState extends ComponentState {
@@ -120,6 +121,7 @@ public class AbstractSplitPanelState extends ComponentState {
return positionReversed;
}
+ @DelegateToWidget
public void setPositionReversed(boolean positionReversed) {
this.positionReversed = positionReversed;
}
@@ -128,6 +130,7 @@ public class AbstractSplitPanelState extends ComponentState {
return locked;
}
+ @DelegateToWidget
public void setLocked(boolean locked) {
this.locked = locked;
}
diff --git a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java
index 31cec77554..50dc1393a3 100644
--- a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java
+++ b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java
@@ -15,6 +15,7 @@
*/
package com.vaadin.shared.ui.textarea;
+import com.vaadin.shared.annotations.DelegateToWidget;
import com.vaadin.shared.ui.textfield.AbstractTextFieldState;
public class TextAreaState extends AbstractTextFieldState {
@@ -33,6 +34,7 @@ public class TextAreaState extends AbstractTextFieldState {
return rows;
}
+ @DelegateToWidget
public void setRows(int rows) {
this.rows = rows;
}
@@ -41,6 +43,7 @@ public class TextAreaState extends AbstractTextFieldState {
return wordwrap;
}
+ @DelegateToWidget
public void setWordwrap(boolean wordwrap) {
this.wordwrap = wordwrap;
}
diff --git a/shared/src/com/vaadin/shared/ui/root/PageClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java
index b7d9419057..a3cbc10cf6 100644
--- a/shared/src/com/vaadin/shared/ui/root/PageClientRpc.java
+++ b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java
@@ -14,7 +14,7 @@
* the License.
*/
-package com.vaadin.shared.ui.root;
+package com.vaadin.shared.ui.ui;
import com.vaadin.shared.communication.ClientRpc;
diff --git a/shared/src/com/vaadin/shared/ui/root/RootConstants.java b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java
index 34c17ac71f..76413628a4 100644
--- a/shared/src/com/vaadin/shared/ui/root/RootConstants.java
+++ b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java
@@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.shared.ui.root;
+package com.vaadin.shared.ui.ui;
-public class RootConstants {
+public class UIConstants {
/**
* Attribute name for the lazy resize setting .
*/
@@ -41,4 +41,9 @@ public class RootConstants {
@Deprecated
public static final String ATTRIBUTE_NOTIFICATION_DELAY = "delay";
+ /**
+ * Name of the parameter used to transmit UI ids back and forth
+ */
+ public static final String UI_ID_PARAMETER = "uiId";
+
}
diff --git a/shared/src/com/vaadin/shared/ui/root/RootServerRpc.java b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java
index df2031f7d5..ef28a12415 100644
--- a/shared/src/com/vaadin/shared/ui/root/RootServerRpc.java
+++ b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java
@@ -13,13 +13,13 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.shared.ui.root;
+package com.vaadin.shared.ui.ui;
import com.vaadin.shared.annotations.Delayed;
import com.vaadin.shared.communication.ServerRpc;
import com.vaadin.shared.ui.ClickRpc;
-public interface RootServerRpc extends ClickRpc, ServerRpc {
+public interface UIServerRpc extends ClickRpc, ServerRpc {
@Delayed(lastonly = true)
public void resize(int viewWidth, int viewHeight, int windowWidth,
int windowHeight);
diff --git a/shared/src/com/vaadin/shared/ui/root/RootState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java
index b7c2c88ce5..01426bd8f3 100644
--- a/shared/src/com/vaadin/shared/ui/root/RootState.java
+++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java
@@ -13,12 +13,12 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package com.vaadin.shared.ui.root;
+package com.vaadin.shared.ui.ui;
import com.vaadin.shared.ComponentState;
import com.vaadin.shared.Connector;
-public class RootState extends ComponentState {
+public class UIState extends ComponentState {
private Connector content;
public Connector getContent() {