aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2012-04-04 15:04:23 +0300
committerHenri Sara <hesara@vaadin.com>2012-04-04 15:04:23 +0300
commit87e5022ca881154f7e4cba9b2c014b344646fa8f (patch)
treef60e74ea9b6b84f6f1ff75da58f59819d7666a54 /src/com/vaadin
parent6bf22c0d4359034e2f934038382895f177f6a458 (diff)
downloadvaadin-framework-87e5022ca881154f7e4cba9b2c014b344646fa8f.tar.gz
vaadin-framework-87e5022ca881154f7e4cba9b2c014b344646fa8f.zip
Replace @ClientWidget with client-side @Component (#8440)
Diffstat (limited to 'src/com/vaadin')
-rw-r--r--src/com/vaadin/event/dd/acceptcriteria/ClientCriterion.java5
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java50
-rw-r--r--src/com/vaadin/terminal/gwt/client/ApplicationConnection.java22
-rw-r--r--src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java12
-rw-r--r--src/com/vaadin/terminal/gwt/client/WidgetMap.java46
-rw-r--r--src/com/vaadin/terminal/gwt/client/WidgetSet.java45
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/AbsoluteLayoutConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/AccordionConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/AudioConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/CheckBoxConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/ComboBoxConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/Component.java (renamed from src/com/vaadin/ui/ClientWidget.java)29
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/CssLayoutConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/CustomComponentConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/CustomFieldConnector.java22
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/CustomLayoutConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/DragAndDropWrapperConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/EmbeddedConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/FormConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/FormLayoutConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/GridLayoutConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/HorizontalLayoutConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/HorizontalSplitPanelConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/InlineDateFieldConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/LinkConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/ListSelectConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/MenuBarConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/NativeSelectConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/OptionGroupConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/PasswordFieldConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/PopupDateFieldConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/PopupViewConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/ProgressIndicatorConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/RootConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/SliderConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/TableConnector.java1
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/TabsheetConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/TextAreaConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/TextFieldConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/TreeTableConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/TwinColSelectConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java19
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/UploadConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VerticalLayoutConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VerticalSplitPanelConnector.java3
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VideoConnector.java2
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java1
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/label/LabelConnector.java4
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java4
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java34
-rw-r--r--src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java174
-rw-r--r--src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java19
-rw-r--r--src/com/vaadin/terminal/gwt/widgetsetutils/CustomWidgetMapGenerator.java42
-rw-r--r--src/com/vaadin/terminal/gwt/widgetsetutils/EagerWidgetMapGenerator.java12
-rw-r--r--src/com/vaadin/terminal/gwt/widgetsetutils/LazyWidgetMapGenerator.java7
-rw-r--r--src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java193
-rw-r--r--src/com/vaadin/ui/AbsoluteLayout.java1
-rw-r--r--src/com/vaadin/ui/Accordion.java3
-rw-r--r--src/com/vaadin/ui/Audio.java2
-rw-r--r--src/com/vaadin/ui/Button.java3
-rw-r--r--src/com/vaadin/ui/CheckBox.java2
-rw-r--r--src/com/vaadin/ui/ComboBox.java2
-rw-r--r--src/com/vaadin/ui/CssLayout.java1
-rw-r--r--src/com/vaadin/ui/CustomComponent.java4
-rw-r--r--src/com/vaadin/ui/CustomField.java2
-rw-r--r--src/com/vaadin/ui/CustomLayout.java2
-rw-r--r--src/com/vaadin/ui/DateField.java2
-rw-r--r--src/com/vaadin/ui/DragAndDropWrapper.java2
-rw-r--r--src/com/vaadin/ui/Embedded.java1
-rw-r--r--src/com/vaadin/ui/Form.java2
-rw-r--r--src/com/vaadin/ui/FormLayout.java2
-rw-r--r--src/com/vaadin/ui/GridLayout.java1
-rw-r--r--src/com/vaadin/ui/HorizontalLayout.java3
-rw-r--r--src/com/vaadin/ui/HorizontalSplitPanel.java3
-rw-r--r--src/com/vaadin/ui/InlineDateField.java2
-rw-r--r--src/com/vaadin/ui/Label.java3
-rw-r--r--src/com/vaadin/ui/Link.java2
-rw-r--r--src/com/vaadin/ui/ListSelect.java2
-rw-r--r--src/com/vaadin/ui/MenuBar.java3
-rw-r--r--src/com/vaadin/ui/NativeButton.java2
-rw-r--r--src/com/vaadin/ui/NativeSelect.java2
-rw-r--r--src/com/vaadin/ui/OptionGroup.java2
-rw-r--r--src/com/vaadin/ui/Panel.java1
-rw-r--r--src/com/vaadin/ui/PasswordField.java2
-rw-r--r--src/com/vaadin/ui/PopupView.java2
-rw-r--r--src/com/vaadin/ui/ProgressIndicator.java2
-rw-r--r--src/com/vaadin/ui/RichTextArea.java3
-rw-r--r--src/com/vaadin/ui/Root.java2
-rw-r--r--src/com/vaadin/ui/Select.java2
-rw-r--r--src/com/vaadin/ui/Slider.java2
-rw-r--r--src/com/vaadin/ui/TabSheet.java2
-rw-r--r--src/com/vaadin/ui/Table.java2
-rw-r--r--src/com/vaadin/ui/TextArea.java2
-rw-r--r--src/com/vaadin/ui/TextField.java3
-rw-r--r--src/com/vaadin/ui/Tree.java1
-rw-r--r--src/com/vaadin/ui/TreeTable.java2
-rw-r--r--src/com/vaadin/ui/TwinColSelect.java2
-rw-r--r--src/com/vaadin/ui/Upload.java3
-rw-r--r--src/com/vaadin/ui/VerticalLayout.java4
-rw-r--r--src/com/vaadin/ui/VerticalSplitPanel.java3
-rw-r--r--src/com/vaadin/ui/Video.java1
-rw-r--r--src/com/vaadin/ui/Window.java1
106 files changed, 448 insertions, 480 deletions
diff --git a/src/com/vaadin/event/dd/acceptcriteria/ClientCriterion.java b/src/com/vaadin/event/dd/acceptcriteria/ClientCriterion.java
index 920112360e..8b64106be7 100644
--- a/src/com/vaadin/event/dd/acceptcriteria/ClientCriterion.java
+++ b/src/com/vaadin/event/dd/acceptcriteria/ClientCriterion.java
@@ -9,13 +9,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.vaadin.terminal.gwt.client.ui.dd.VAcceptCriterion;
-import com.vaadin.ui.ClientWidget;
/**
* An annotation type used to point the client side counterpart for server side
- * a {@link AcceptCriterion} class. Usage is pretty similar to
- * {@link ClientWidget} which is used with Vaadin components that have a
- * specialized client side counterpart.
+ * a {@link AcceptCriterion} class.
* <p>
* Annotations are used at GWT compilation phase, so remember to rebuild your
* widgetset if you do changes for {@link ClientCriterion} mappings.
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
index e166abc688..fabaeddc78 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java
@@ -7,6 +7,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
@@ -206,12 +207,10 @@ public class ApplicationConfiguration implements EntryPoint {
private boolean usePortletURLs = false;
private String portletUidlURLBase;
- private HashMap<String, String> unknownComponents;
+ private HashMap<Integer, String> unknownComponents;
private Class<? extends ComponentConnector>[] classes = new Class[1024];
- private String windowId;
-
private boolean browserDetailsSent = false;
static// TODO consider to make this hashmap per application
@@ -221,6 +220,9 @@ public class ApplicationConfiguration implements EntryPoint {
private static ArrayList<ApplicationConnection> runningApplications = new ArrayList<ApplicationConnection>();
+ private Map<Integer, Integer> componentInheritanceMap = new HashMap<Integer, Integer>();
+ private Map<Integer, String> tagToServerSideClassName = new HashMap<Integer, String>();
+
public boolean usePortletURLs() {
return usePortletURLs;
}
@@ -391,42 +393,54 @@ public class ApplicationConfiguration implements EntryPoint {
}
public Class<? extends ComponentConnector> getWidgetClassByEncodedTag(
- String tag) {
+ int tag) {
try {
- int parseInt = Integer.parseInt(tag);
- return classes[parseInt];
+ return classes[tag];
} catch (Exception e) {
// component was not present in mappings
return UnknownComponentConnector.class;
}
}
+ public void addComponentInheritanceInfo(ValueMap valueMap) {
+ JsArrayString keyArray = valueMap.getKeyArray();
+ for (int i = 0; i < keyArray.length(); i++) {
+ String key = keyArray.get(i);
+ int value = valueMap.getInt(key);
+ componentInheritanceMap.put(Integer.parseInt(key), value);
+ }
+ }
+
public void addComponentMappings(ValueMap valueMap, WidgetSet widgetSet) {
JsArrayString keyArray = valueMap.getKeyArray();
for (int i = 0; i < keyArray.length(); i++) {
String key = keyArray.get(i).intern();
int value = valueMap.getInt(key);
- classes[value] = widgetSet.getImplementationByClassName(key);
+ tagToServerSideClassName.put(value, key);
+ }
+
+ for (int i = 0; i < keyArray.length(); i++) {
+ String key = keyArray.get(i).intern();
+ int value = valueMap.getInt(key);
+ classes[value] = widgetSet.getConnectorClassByTag(value, this);
if (classes[value] == UnknownComponentConnector.class) {
if (unknownComponents == null) {
- unknownComponents = new HashMap<String, String>();
+ unknownComponents = new HashMap<Integer, String>();
}
- unknownComponents.put("" + value, key);
- } else if (key == "com.vaadin.ui.Root") {
- windowId = "" + value;
+ unknownComponents.put(value, key);
}
}
}
- /**
- * @return the integer value that is used to code top level windows
- * "com.vaadin.ui.Window"
- */
- String getEncodedWindowTag() {
- return windowId;
+ public Integer getParentTag(int tag) {
+ return componentInheritanceMap.get(tag);
+ }
+
+ public String getServerSideClassNameForTag(Integer tag) {
+ return tagToServerSideClassName.get(tag);
}
- String getUnknownServerClassNameByEncodedTagName(String tag) {
+ String getUnknownServerClassNameByTag(int tag) {
if (unknownComponents != null) {
return unknownComponents.get(tag);
}
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index 31a1bf2954..11b7820a11 100644
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -957,6 +957,11 @@ public class ApplicationConnection {
}
}
+ if (json.containsKey("typeInheritanceMap")) {
+ configuration.addComponentInheritanceInfo(json
+ .getValueMap("typeInheritanceMap"));
+ }
+
if (json.containsKey("typeMappings")) {
configuration.addComponentMappings(
json.getValueMap("typeMappings"), widgetSet);
@@ -1166,15 +1171,19 @@ public class ApplicationConnection {
for (int i = 0; i < keyArray.length(); i++) {
try {
String connectorId = keyArray.get(i);
- String connectorType = types.getString(connectorId);
+ int connectorType = Integer.parseInt(types
+ .getString((connectorId)));
ServerConnector connector = connectorMap
.getConnector(connectorId);
if (connector != null) {
continue;
}
+
+ Class<? extends ComponentConnector> connectorClass = configuration
+ .getWidgetClassByEncodedTag(connectorType);
+
// Connector does not exist so we must create it
- if (!connectorType.equals(configuration
- .getEncodedWindowTag())) {
+ if (connectorClass != RootConnector.class) {
// create, initialize and register the paintable
getConnector(connectorId, connectorType);
} else {
@@ -1902,7 +1911,7 @@ public class ApplicationConnection {
@Deprecated
public ComponentConnector getPaintable(UIDL uidl) {
- return getConnector(uidl.getId(), uidl.getTag());
+ return getConnector(uidl.getId(), Integer.parseInt(uidl.getTag()));
}
/**
@@ -1921,8 +1930,7 @@ public class ApplicationConnection {
* @return Either an existing ComponentConnector or a new ComponentConnector
* of the given type
*/
- public ComponentConnector getConnector(String connectorId,
- String connectorType) {
+ public ComponentConnector getConnector(String connectorId, int connectorType) {
if (!connectorMap.hasConnector(connectorId)) {
return createAndRegisterConnector(connectorId, connectorType);
}
@@ -1943,7 +1951,7 @@ public class ApplicationConnection {
* @return A new ComponentConnector of the given type
*/
private ComponentConnector createAndRegisterConnector(String connectorId,
- String connectorType) {
+ int connectorType) {
// Create and register a new connector with the given type
ComponentConnector p = widgetSet.createWidget(connectorType,
configuration);
diff --git a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java
index 3642d0ff2e..bd79e5f9c6 100644
--- a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java
+++ b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java
@@ -78,8 +78,7 @@ public class VUIDLBrowser extends SimpleTree {
try {
String name = uidl.getTag();
try {
- Integer.parseInt(name);
- name = getNodeName(uidl, conf, name);
+ name = getNodeName(uidl, conf, Integer.parseInt(name));
} catch (Exception e) {
// NOP
}
@@ -98,11 +97,11 @@ public class VUIDLBrowser extends SimpleTree {
}
private String getNodeName(UIDL uidl, ApplicationConfiguration conf,
- String name) {
+ int tag) {
Class<? extends ComponentConnector> widgetClassByDecodedTag = conf
- .getWidgetClassByEncodedTag(name);
+ .getWidgetClassByEncodedTag(tag);
if (widgetClassByDecodedTag == UnknownComponentConnector.class) {
- return conf.getUnknownServerClassNameByEncodedTagName(name)
+ return conf.getUnknownServerClassNameByTag(tag)
+ "(NO CLIENT IMPLEMENTATION FOUND)";
} else {
return widgetClassByDecodedTag.getName();
@@ -144,8 +143,7 @@ public class VUIDLBrowser extends SimpleTree {
String nodeName = uidl.getTag();
try {
- Integer.parseInt(nodeName);
- nodeName = getNodeName(uidl, conf, nodeName);
+ nodeName = getNodeName(uidl, conf, Integer.parseInt(nodeName));
} catch (Exception e) {
// NOP
}
diff --git a/src/com/vaadin/terminal/gwt/client/WidgetMap.java b/src/com/vaadin/terminal/gwt/client/WidgetMap.java
index 4fcadd6398..af84a11ced 100644
--- a/src/com/vaadin/terminal/gwt/client/WidgetMap.java
+++ b/src/com/vaadin/terminal/gwt/client/WidgetMap.java
@@ -5,24 +5,60 @@ package com.vaadin.terminal.gwt.client;
import java.util.HashMap;
+import com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator;
+
+/**
+ * Abstract class mapping between {@link ComponentConnector} instances and their
+ * instances.
+ *
+ * A concrete implementation of this class is generated by
+ * {@link WidgetMapGenerator} or one of its subclasses during widgetset
+ * compilation.
+ */
abstract class WidgetMap {
protected static HashMap<Class, WidgetInstantiator> instmap = new HashMap<Class, WidgetInstantiator>();
- // FIXME: Should use Paintable and not VPaintableWidget
+ /**
+ * Create a new instance of a connector based on its type.
+ *
+ * @param classType
+ * {@link ComponentConnector} class to instantiate
+ * @return new instance of the connector
+ */
public ComponentConnector instantiate(
Class<? extends ComponentConnector> classType) {
return instmap.get(classType).get();
}
- // FIXME: Should use Paintable and not VPaintableWidget
- public abstract Class<? extends ComponentConnector> getImplementationByServerSideClassName(
+ /**
+ * Return the connector class to use for a fully qualified server side
+ * component class name.
+ *
+ * @param fullyqualifiedName
+ * fully qualified name of the server side component class
+ * @return component connector class to use
+ */
+ public abstract Class<? extends ComponentConnector> getConnectorClassForServerSideClassName(
String fullyqualifiedName);
- // FIXME: Should use Paintable and not VPaintableWidget
+ /**
+ * Return the connector classes to load after the initial widgetset load and
+ * start.
+ *
+ * @return component connector class to load after the initial widgetset
+ * loading
+ */
public abstract Class<? extends ComponentConnector>[] getDeferredLoadedWidgets();
- // FIXME: Should use Paintable and not VPaintableWidget
+ /**
+ * Make sure the code for a (deferred or lazy) component connector type has
+ * been loaded, triggering the load and waiting for its completion if
+ * necessary.
+ *
+ * @param classType
+ * component connector class
+ */
public abstract void ensureInstantiator(
Class<? extends ComponentConnector> classType);
diff --git a/src/com/vaadin/terminal/gwt/client/WidgetSet.java b/src/com/vaadin/terminal/gwt/client/WidgetSet.java
index 656c92e285..5aa4b24764 100644
--- a/src/com/vaadin/terminal/gwt/client/WidgetSet.java
+++ b/src/com/vaadin/terminal/gwt/client/WidgetSet.java
@@ -30,7 +30,7 @@ public class WidgetSet {
* @return New uninitialized and unregistered component that can paint given
* UIDL.
*/
- public ComponentConnector createWidget(String tag,
+ public ComponentConnector createWidget(int tag,
ApplicationConfiguration conf) {
/*
* Yes, this (including the generated code in WidgetMap) may look very
@@ -40,12 +40,12 @@ public class WidgetSet {
* has no "native" counterpart on client side.
*/
- Class<? extends ComponentConnector> classType = resolveWidgetType(tag,
- conf);
+ Class<? extends ComponentConnector> classType = resolveInheritedWidgetType(
+ conf, tag);
if (classType == null || classType == UnknownComponentConnector.class) {
String serverSideName = conf
- .getUnknownServerClassNameByEncodedTagName(tag);
+ .getUnknownServerClassNameByTag(tag);
UnknownComponentConnector c = GWT
.create(UnknownComponentConnector.class);
c.setServerSideClassName(serverSideName);
@@ -56,16 +56,25 @@ public class WidgetSet {
*/
return widgetMap.instantiate(classType);
}
+ }
+ private Class<? extends ComponentConnector> resolveInheritedWidgetType(
+ ApplicationConfiguration conf, int tag) {
+ Class<? extends ComponentConnector> classType = null;
+ Integer t = tag;
+ do {
+ classType = resolveWidgetType(t, conf);
+ t = conf.getParentTag(t);
+ } while (classType == null && t != null);
+ return classType;
}
- protected Class<? extends ComponentConnector> resolveWidgetType(String tag,
+ protected Class<? extends ComponentConnector> resolveWidgetType(int tag,
ApplicationConfiguration conf) {
Class<? extends ComponentConnector> widgetClass = conf
.getWidgetClassByEncodedTag(tag);
return widgetClass;
-
}
/**
@@ -73,20 +82,22 @@ public class WidgetSet {
* limitation, widgetset must have function that returns Class by its fully
* qualified name.
*
- * @param fullyQualifiedName
+ * @param tag
* @param applicationConfiguration
* @return
*/
- public Class<? extends ComponentConnector> getImplementationByClassName(
- String fullyqualifiedName) {
- if (fullyqualifiedName == null) {
- return UnknownComponentConnector.class;
- }
- Class<? extends ComponentConnector> implementationByServerSideClassName = widgetMap
- .getImplementationByServerSideClassName(fullyqualifiedName);
-
- return implementationByServerSideClassName;
-
+ public Class<? extends ComponentConnector> getConnectorClassByTag(int tag,
+ ApplicationConfiguration conf) {
+ Class<? extends ComponentConnector> connectorClass = null;
+ Integer t = tag;
+ do {
+ connectorClass = widgetMap
+ .getConnectorClassForServerSideClassName(conf
+ .getServerSideClassNameForTag(t));
+ t = conf.getParentTag(t);
+ } while (connectorClass == UnknownComponentConnector.class && t != null);
+
+ return connectorClass;
}
public Class<? extends ComponentConnector>[] getDeferredLoadedWidgets() {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbsoluteLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbsoluteLayoutConnector.java
index f0942066f2..c600cf1500 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/AbsoluteLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/AbsoluteLayoutConnector.java
@@ -17,7 +17,9 @@ import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
import com.vaadin.terminal.gwt.client.ui.VAbsoluteLayout.AbsoluteWrapper;
+import com.vaadin.ui.AbsoluteLayout;
+@Component(AbsoluteLayout.class)
public class AbsoluteLayoutConnector extends
AbstractComponentContainerConnector implements DirectionalManagedLayout {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AccordionConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AccordionConnector.java
index 7153d46e4d..e54f078a94 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/AccordionConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/AccordionConnector.java
@@ -11,7 +11,9 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VAccordion.StackItem;
+import com.vaadin.ui.Accordion;
+@Component(Accordion.class)
public class AccordionConnector extends TabsheetBaseConnector implements
SimpleManagedLayout {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/AudioConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AudioConnector.java
index fe1993a35d..c3c14449c0 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/AudioConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/AudioConnector.java
@@ -10,7 +10,9 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.BrowserInfo;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.Audio;
+@Component(Audio.class)
public class AudioConnector extends MediaBaseConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java b/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java
index 55da944f9f..1549aa873d 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/ButtonConnector.java
@@ -13,7 +13,10 @@ import com.vaadin.terminal.gwt.client.EventHelper;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.Button;
+@Component(value = Button.class, loadStyle = LoadStyle.EAGER)
public class ButtonConnector extends AbstractComponentConnector {
/**
diff --git a/src/com/vaadin/terminal/gwt/client/ui/CheckBoxConnector.java b/src/com/vaadin/terminal/gwt/client/ui/CheckBoxConnector.java
index 02f237f5c4..fb80f539e9 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/CheckBoxConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/CheckBoxConnector.java
@@ -11,7 +11,9 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.EventHelper;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VTooltip;
+import com.vaadin.ui.CheckBox;
+@Component(CheckBox.class)
public class CheckBoxConnector extends AbstractFieldConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/ComboBoxConnector.java b/src/com/vaadin/terminal/gwt/client/ui/ComboBoxConnector.java
index 529046a307..6199ec98b5 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/ComboBoxConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/ComboBoxConnector.java
@@ -11,7 +11,9 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.VFilterSelect.FilterSelectSuggestion;
+import com.vaadin.ui.Select;
+@Component(Select.class)
public class ComboBoxConnector extends AbstractFieldConnector implements
SimpleManagedLayout {
diff --git a/src/com/vaadin/ui/ClientWidget.java b/src/com/vaadin/terminal/gwt/client/ui/Component.java
index 93f17f38b8..b345c98120 100644
--- a/src/com/vaadin/ui/ClientWidget.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/Component.java
@@ -1,10 +1,7 @@
/*
@VaadinApache2LicenseForJavaFiles@
*/
-/**
- *
- */
-package com.vaadin.ui;
+package com.vaadin.terminal.gwt.client.ui;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@@ -12,31 +9,30 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.server.ClientConnector;
import com.vaadin.terminal.gwt.widgetsetutils.CustomWidgetMapGenerator;
import com.vaadin.terminal.gwt.widgetsetutils.EagerWidgetMapGenerator;
import com.vaadin.terminal.gwt.widgetsetutils.LazyWidgetMapGenerator;
import com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator;
/**
- * Annotation defining the default client side counterpart in GWT terminal for
- * {@link Component}.
+ * Annotation defining the default server side counterpart in GWT terminal for
+ * {@link ComponentConnector}.
* <p>
- * With this annotation server side Vaadin component is marked to have a client
- * side counterpart. The value of the annotation is the class of client side
+ * With this annotation client side Vaadin connector is marked to have a server
+ * side counterpart. The value of the annotation is the class of server side
* implementation.
- * <p>
- * Note, even though client side implementation is needed during development,
- * one may safely remove them from the classpath of the production server.
*
- * @since 6.2
+ * @since 7.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
-public @interface ClientWidget {
+public @interface Component {
+
/**
- * @return the client side counterpart for the annotated component
+ * @return the server side counterpart for the annotated component connector
*/
- Class<? extends ComponentConnector> value();
+ Class<? extends ClientConnector> value();
/**
* Depending on the used WidgetMap generator, these optional hints may be
@@ -49,7 +45,7 @@ public @interface ClientWidget {
* is not included in the initial JavaScript application loaded when the
* application starts. Instead the implementation is loaded to the client
* when it is first needed. Lazy loaded widget can be achieved by giving
- * {@link LoadStyle#LAZY} value in ClientWidget annotation.
+ * {@link LoadStyle#LAZY} value in {@link Component} annotation.
* <p>
* Lazy loaded widgets don't stress the size and startup time of the client
* side as much as eagerly loaded widgets. On the other hand there is a
@@ -93,5 +89,4 @@ public @interface ClientWidget {
*/
LAZY
}
-
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/CssLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/CssLayoutConnector.java
index 3b72f73a3b..8bf14fdbdb 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/CssLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/CssLayoutConnector.java
@@ -10,7 +10,9 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.ui.CssLayout;
+@Component(CssLayout.class)
public class CssLayoutConnector extends AbstractComponentContainerConnector {
private LayoutClickEventHandler clickEventHandler = new LayoutClickEventHandler(
diff --git a/src/com/vaadin/terminal/gwt/client/ui/CustomComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/CustomComponentConnector.java
index 860ec97a5b..5c7f2c64c3 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/CustomComponentConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/CustomComponentConnector.java
@@ -7,7 +7,10 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ConnectorHierarchyChangedEvent;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.CustomComponent;
+@Component(value = CustomComponent.class, loadStyle = LoadStyle.EAGER)
public class CustomComponentConnector extends
AbstractComponentContainerConnector {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/CustomFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/CustomFieldConnector.java
new file mode 100644
index 0000000000..477a4b496a
--- /dev/null
+++ b/src/com/vaadin/terminal/gwt/client/ui/CustomFieldConnector.java
@@ -0,0 +1,22 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.terminal.gwt.client.ui;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.ui.CustomField;
+
+@Component(value = CustomField.class)
+public class CustomFieldConnector extends CustomComponentConnector {
+
+ @Override
+ protected Widget createWidget() {
+ return GWT.create(VCustomComponent.class);
+ }
+
+ @Override
+ public VCustomComponent getWidget() {
+ return super.getWidget();
+ }
+}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/CustomLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/CustomLayoutConnector.java
index 2941afe901..089245b392 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/CustomLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/CustomLayoutConnector.java
@@ -13,7 +13,9 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.CustomLayout;
+@Component(CustomLayout.class)
public class CustomLayoutConnector extends AbstractComponentContainerConnector
implements SimpleManagedLayout {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/DragAndDropWrapperConnector.java b/src/com/vaadin/terminal/gwt/client/ui/DragAndDropWrapperConnector.java
index 4b44585caa..dcb2ed8023 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/DragAndDropWrapperConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/DragAndDropWrapperConnector.java
@@ -10,7 +10,9 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.DragAndDropWrapper;
+@Component(DragAndDropWrapper.class)
public class DragAndDropWrapperConnector extends CustomComponentConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/EmbeddedConnector.java b/src/com/vaadin/terminal/gwt/client/ui/EmbeddedConnector.java
index a9b0220329..bd8a242c67 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/EmbeddedConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/EmbeddedConnector.java
@@ -23,7 +23,9 @@ import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VConsole;
import com.vaadin.terminal.gwt.client.VTooltip;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.ui.Embedded;
+@Component(Embedded.class)
public class EmbeddedConnector extends AbstractComponentConnector {
public interface EmbeddedServerRPC extends ClickRPC, ServerRpc {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java b/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java
index 01bd8ce007..5ed86fce6d 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/FormConnector.java
@@ -14,7 +14,9 @@ import com.vaadin.terminal.gwt.client.ComponentState;
import com.vaadin.terminal.gwt.client.ConnectorMap;
import com.vaadin.terminal.gwt.client.LayoutManager;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.Form;
+@Component(Form.class)
public class FormConnector extends AbstractComponentContainerConnector
implements SimpleManagedLayout {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/FormLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/FormLayoutConnector.java
index 1c402309ac..bd9feed29c 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/FormLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/FormLayoutConnector.java
@@ -10,7 +10,9 @@ import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VFormLayout.Caption;
import com.vaadin.terminal.gwt.client.ui.VFormLayout.ErrorFlag;
+import com.vaadin.ui.FormLayout;
+@Component(FormLayout.class)
public class FormLayoutConnector extends AbstractComponentContainerConnector {
@Override
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/GridLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/GridLayoutConnector.java
index d6acc36ea7..06e61bf5e9 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/GridLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/GridLayoutConnector.java
@@ -18,7 +18,9 @@ import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
import com.vaadin.terminal.gwt.client.ui.VGridLayout.Cell;
import com.vaadin.terminal.gwt.client.ui.layout.VLayoutSlot;
+import com.vaadin.ui.GridLayout;
+@Component(GridLayout.class)
public class GridLayoutConnector extends AbstractComponentContainerConnector
implements DirectionalManagedLayout {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/HorizontalLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/HorizontalLayoutConnector.java
index fc370fcd2d..da1ea99f28 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/HorizontalLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/HorizontalLayoutConnector.java
@@ -4,7 +4,10 @@
package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.core.client.GWT;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.HorizontalLayout;
+@Component(value = HorizontalLayout.class, loadStyle = LoadStyle.EAGER)
public class HorizontalLayoutConnector extends AbstractOrderedLayoutConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/HorizontalSplitPanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/HorizontalSplitPanelConnector.java
index 17d264a707..4f441b2d04 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/HorizontalSplitPanelConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/HorizontalSplitPanelConnector.java
@@ -4,7 +4,10 @@
package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.core.client.GWT;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.HorizontalSplitPanel;
+@Component(value = HorizontalSplitPanel.class, loadStyle = LoadStyle.EAGER)
public class HorizontalSplitPanelConnector extends AbstractSplitPanelConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/InlineDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/InlineDateFieldConnector.java
index d5de2c1b09..31ffe199d8 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/InlineDateFieldConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/InlineDateFieldConnector.java
@@ -12,7 +12,9 @@ import com.vaadin.terminal.gwt.client.DateTimeService;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusChangeListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.TimeChangeListener;
+import com.vaadin.ui.InlineDateField;
+@Component(InlineDateField.class)
public class InlineDateFieldConnector extends AbstractDateFieldConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/LinkConnector.java b/src/com/vaadin/terminal/gwt/client/ui/LinkConnector.java
index cd41fab7af..c33676845a 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/LinkConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/LinkConnector.java
@@ -9,7 +9,9 @@ import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.Link;
+@Component(Link.class)
public class LinkConnector extends AbstractComponentConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/ListSelectConnector.java b/src/com/vaadin/terminal/gwt/client/ui/ListSelectConnector.java
index c470acbcf1..ce9fb91f9a 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/ListSelectConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/ListSelectConnector.java
@@ -6,7 +6,9 @@ package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.ui.ListSelect;
+@Component(ListSelect.class)
public class ListSelectConnector extends OptionGroupBaseConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/MenuBarConnector.java b/src/com/vaadin/terminal/gwt/client/ui/MenuBarConnector.java
index 3a2a7a7292..36cc454a03 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/MenuBarConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/MenuBarConnector.java
@@ -12,8 +12,10 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
import com.vaadin.terminal.gwt.client.ui.VMenuBar.CustomMenuItem;
+@Component(value = com.vaadin.ui.MenuBar.class, loadStyle = LoadStyle.LAZY)
public class MenuBarConnector extends AbstractComponentConnector implements
SimpleManagedLayout {
/**
diff --git a/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java b/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java
index c26058fe99..1790a42b21 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/NativeButtonConnector.java
@@ -11,7 +11,9 @@ import com.vaadin.terminal.gwt.client.ComponentState;
import com.vaadin.terminal.gwt.client.EventHelper;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.ButtonConnector.ButtonServerRpc;
+import com.vaadin.ui.NativeButton;
+@Component(NativeButton.class)
public class NativeButtonConnector extends AbstractComponentConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/NativeSelectConnector.java b/src/com/vaadin/terminal/gwt/client/ui/NativeSelectConnector.java
index c425ccb93d..0d85f3ed95 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/NativeSelectConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/NativeSelectConnector.java
@@ -6,7 +6,9 @@ package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.ui.NativeSelect;
+@Component(NativeSelect.class)
public class NativeSelectConnector extends OptionGroupBaseConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/OptionGroupConnector.java b/src/com/vaadin/terminal/gwt/client/ui/OptionGroupConnector.java
index 76204bcb07..8c9811756f 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/OptionGroupConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/OptionGroupConnector.java
@@ -13,7 +13,9 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.EventId;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.OptionGroup;
+@Component(OptionGroup.class)
public class OptionGroupConnector extends OptionGroupBaseConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java
index 03a76839e7..4dc4098c14 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/PanelConnector.java
@@ -17,7 +17,9 @@ import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
+import com.vaadin.ui.Panel;
+@Component(Panel.class)
public class PanelConnector extends AbstractComponentContainerConnector
implements SimpleManagedLayout, PostLayoutListener {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/PasswordFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/PasswordFieldConnector.java
index 5086bdb416..996e82f405 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/PasswordFieldConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/PasswordFieldConnector.java
@@ -8,7 +8,9 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.PasswordField;
+@Component(PasswordField.class)
public class PasswordFieldConnector extends TextFieldConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/PopupDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/PopupDateFieldConnector.java
index 0e4afde99a..05cd0466a9 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/PopupDateFieldConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/PopupDateFieldConnector.java
@@ -13,7 +13,9 @@ import com.vaadin.terminal.gwt.client.DateTimeService;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.FocusChangeListener;
import com.vaadin.terminal.gwt.client.ui.VCalendarPanel.TimeChangeListener;
+import com.vaadin.ui.DateField;
+@Component(DateField.class)
public class PopupDateFieldConnector extends TextualDateConnector {
/*
diff --git a/src/com/vaadin/terminal/gwt/client/ui/PopupViewConnector.java b/src/com/vaadin/terminal/gwt/client/ui/PopupViewConnector.java
index 746b22577c..d2162bdbcc 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/PopupViewConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/PopupViewConnector.java
@@ -10,7 +10,9 @@ import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.VCaption;
import com.vaadin.terminal.gwt.client.VCaptionWrapper;
+import com.vaadin.ui.PopupView;
+@Component(PopupView.class)
public class PopupViewConnector extends AbstractComponentContainerConnector
implements PostLayoutListener {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/ProgressIndicatorConnector.java b/src/com/vaadin/terminal/gwt/client/ui/ProgressIndicatorConnector.java
index 21c6a06a36..3c3a5ecbc2 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/ProgressIndicatorConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/ProgressIndicatorConnector.java
@@ -9,7 +9,9 @@ import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.ProgressIndicator;
+@Component(ProgressIndicator.class)
public class ProgressIndicatorConnector extends AbstractFieldConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java b/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java
index 3ddeec10b7..7db14d73f0 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/RootConnector.java
@@ -32,7 +32,10 @@ import com.vaadin.terminal.gwt.client.VConsole;
import com.vaadin.terminal.gwt.client.communication.ServerRpc;
import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
import com.vaadin.terminal.gwt.client.communication.StateChangeEvent.StateChangeHandler;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.Root;
+@Component(value = Root.class, loadStyle = LoadStyle.EAGER)
public class RootConnector extends AbstractComponentContainerConnector {
public interface RootServerRPC extends ClickRPC, ServerRpc {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/SliderConnector.java b/src/com/vaadin/terminal/gwt/client/ui/SliderConnector.java
index 4e299c947f..24832e04ce 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/SliderConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/SliderConnector.java
@@ -9,7 +9,9 @@ import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.Slider;
+@Component(Slider.class)
public class SliderConnector extends AbstractFieldConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java
index 370d4bc001..14231c3504 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/TableConnector.java
@@ -21,6 +21,7 @@ import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.VScrollTable.ContextMenuDetails;
import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
+@Component(com.vaadin.ui.Table.class)
public class TableConnector extends AbstractComponentContainerConnector
implements DirectionalManagedLayout, PostLayoutListener {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TabsheetConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TabsheetConnector.java
index 180fb8ac34..297bb06400 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/TabsheetConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/TabsheetConnector.java
@@ -9,7 +9,9 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.TabSheet;
+@Component(TabSheet.class)
public class TabsheetConnector extends TabsheetBaseConnector implements
SimpleManagedLayout {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TextAreaConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TextAreaConnector.java
index d5dc6dea4e..30a02cd86d 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/TextAreaConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/TextAreaConnector.java
@@ -9,7 +9,9 @@ import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.TextArea;
+@Component(TextArea.class)
public class TextAreaConnector extends TextFieldConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TextFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TextFieldConnector.java
index 274810d6df..ed46403cdf 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/TextFieldConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/TextFieldConnector.java
@@ -11,8 +11,11 @@ import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
+import com.vaadin.ui.TextField;
+@Component(value = TextField.class, loadStyle = LoadStyle.EAGER)
public class TextFieldConnector extends AbstractFieldConnector implements
BeforeShortcutActionListener {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java
index 9e670e46df..dce88ff5ec 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/TreeConnector.java
@@ -13,7 +13,9 @@ import com.vaadin.terminal.gwt.client.ComponentState;
import com.vaadin.terminal.gwt.client.TooltipInfo;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VTree.TreeNode;
+import com.vaadin.ui.Tree;
+@Component(Tree.class)
public class TreeConnector extends AbstractComponentConnector {
public static final String ATTRIBUTE_NODE_STYLE = "style";
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TreeTableConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TreeTableConnector.java
index 575eea0288..15dda772c5 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/TreeTableConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/TreeTableConnector.java
@@ -9,7 +9,9 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
import com.vaadin.terminal.gwt.client.ui.VTreeTable.PendingNavigationEvent;
+import com.vaadin.ui.TreeTable;
+@Component(TreeTable.class)
public class TreeTableConnector extends TableConnector {
public static final String ATTRIBUTE_HIERARCHY_COLUMN_INDEX = "hci";
diff --git a/src/com/vaadin/terminal/gwt/client/ui/TwinColSelectConnector.java b/src/com/vaadin/terminal/gwt/client/ui/TwinColSelectConnector.java
index 03bb70d01a..55e75879ca 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/TwinColSelectConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/TwinColSelectConnector.java
@@ -9,7 +9,9 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.DirectionalManagedLayout;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.TwinColSelect;
+@Component(TwinColSelect.class)
public class TwinColSelectConnector extends OptionGroupBaseConnector implements
DirectionalManagedLayout {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java
index 3af42e9572..b42f5d4bb6 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java
@@ -23,15 +23,16 @@ public class UnknownComponentConnector extends AbstractComponentConnector {
if (!isRealUpdate(uidl)) {
return;
}
- getWidget().setCaption(
- "Widgetset does not contain implementation for "
- + getWidget().serverClassName
- + ". Check its @ClientWidget mapping, widgetsets "
- + "GWT module description file and re-compile your"
- + " widgetset. In case you have downloaded a vaadin"
- + " add-on package, you might want to refer to "
- + "<a href='http://vaadin.com/using-addons'>add-on "
- + "instructions</a>. Unrendered UIDL:");
+ getWidget()
+ .setCaption(
+ "Widgetset does not contain implementation for "
+ + getWidget().serverClassName
+ + ". Check its component connector's @Component mapping, widgetsets "
+ + "GWT module description file and re-compile your"
+ + " widgetset. In case you have downloaded a vaadin"
+ + " add-on package, you might want to refer to "
+ + "<a href='http://vaadin.com/using-addons'>add-on "
+ + "instructions</a>. Unrendered UIDL:");
if (getWidget().uidlTree != null) {
getWidget().uidlTree.removeFromParent();
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/UploadConnector.java b/src/com/vaadin/terminal/gwt/client/ui/UploadConnector.java
index 182156d0e4..6bdc067737 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/UploadConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/UploadConnector.java
@@ -8,7 +8,10 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.Upload;
+@Component(value = Upload.class, loadStyle = LoadStyle.LAZY)
public class UploadConnector extends AbstractComponentConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VerticalLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/VerticalLayoutConnector.java
index 0d17186786..a7109f453c 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VerticalLayoutConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VerticalLayoutConnector.java
@@ -4,7 +4,10 @@
package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.core.client.GWT;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.VerticalLayout;
+@Component(value = VerticalLayout.class, loadStyle = LoadStyle.EAGER)
public class VerticalLayoutConnector extends AbstractOrderedLayoutConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VerticalSplitPanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/VerticalSplitPanelConnector.java
index 26e393f5d6..bbce8572c2 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VerticalSplitPanelConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VerticalSplitPanelConnector.java
@@ -4,7 +4,10 @@
package com.vaadin.terminal.gwt.client.ui;
import com.google.gwt.core.client.GWT;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.VerticalSplitPanel;
+@Component(value = VerticalSplitPanel.class, loadStyle = LoadStyle.EAGER)
public class VerticalSplitPanelConnector extends AbstractSplitPanelConnector {
@Override
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VideoConnector.java b/src/com/vaadin/terminal/gwt/client/ui/VideoConnector.java
index c4e3555b07..95032ebfb2 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VideoConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VideoConnector.java
@@ -7,7 +7,9 @@ import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.ui.Video;
+@Component(Video.class)
public class VideoConnector extends MediaBaseConnector {
public static final String ATTR_POSTER = "poster";
diff --git a/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java b/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java
index e209c2aaa1..8c824b89a9 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/WindowConnector.java
@@ -25,6 +25,7 @@ import com.vaadin.terminal.gwt.client.communication.ServerRpc;
import com.vaadin.terminal.gwt.client.ui.PanelConnector.PanelState;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
+@Component(value = com.vaadin.ui.Window.class)
public class WindowConnector extends AbstractComponentContainerConnector
implements BeforeShortcutActionListener, SimpleManagedLayout,
PostLayoutListener {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/label/LabelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/label/LabelConnector.java
index d76afaf962..70cf30f003 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/label/LabelConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/label/LabelConnector.java
@@ -11,7 +11,11 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.Component;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+import com.vaadin.ui.Label;
+@Component(value = Label.class, loadStyle = LoadStyle.EAGER)
public class LabelConnector extends AbstractComponentConnector {
public LabelConnector() {
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java
index 77835236a5..e618cc253c 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java
@@ -9,8 +9,12 @@ import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.ui.AbstractFieldConnector;
+import com.vaadin.terminal.gwt.client.ui.Component;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
import com.vaadin.terminal.gwt.client.ui.ShortcutActionHandler.BeforeShortcutActionListener;
+import com.vaadin.ui.RichTextArea;
+@Component(value = RichTextArea.class, loadStyle = LoadStyle.LAZY)
public class RichTextAreaConnector extends AbstractFieldConnector implements
BeforeShortcutActionListener {
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 505cebaabf..727680bba2 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -740,6 +740,7 @@ public abstract class AbstractCommunicationManager implements Serializable {
return seckey;
}
+ @SuppressWarnings("unchecked")
public void writeUidlResponse(boolean repaintAll,
final PrintWriter outWriter, Root root, boolean analyzeLayouts)
throws PaintException {
@@ -1040,12 +1041,12 @@ public abstract class AbstractCommunicationManager implements Serializable {
}
outWriter.print("}");
- Collection<Class<? extends Paintable>> usedPaintableTypes = paintTarget
- .getUsedPaintableTypes();
+ Collection<Class<? extends ClientConnector>> usedClientConnectors = paintTarget
+ .getUsedClientConnectors();
boolean typeMappingsOpen = false;
ClientCache clientCache = getClientCache(root);
- for (Class<? extends Paintable> class1 : usedPaintableTypes) {
+ for (Class<? extends ClientConnector> class1 : usedClientConnectors) {
if (clientCache.cache(class1)) {
// client does not know the mapping key for this type, send
// mapping to client
@@ -1059,14 +1060,37 @@ public abstract class AbstractCommunicationManager implements Serializable {
outWriter.print("\"");
outWriter.print(canonicalName);
outWriter.print("\" : ");
- outWriter
- .print(getTagForType((Class<? extends ClientConnector>) class1));
+ outWriter.print(getTagForType(class1));
}
}
if (typeMappingsOpen) {
outWriter.print(" }");
}
+ boolean typeInheritanceMapOpen = false;
+ if (typeMappingsOpen) {
+ // send the whole type inheritance map if any new mappings
+ for (Class<? extends ClientConnector> class1 : usedClientConnectors) {
+ if (!typeInheritanceMapOpen) {
+ typeInheritanceMapOpen = true;
+ outWriter.print(", \"typeInheritanceMap\" : { ");
+ } else {
+ outWriter.print(" , ");
+ }
+ outWriter.print("\"");
+ outWriter.print(getTagForType(class1));
+ outWriter.print("\" : ");
+ // note that if the superclass is not in typeMappings, a "dummy"
+ // tag is used
+ outWriter
+ .print(getTagForType((Class<? extends ClientConnector>) class1
+ .getSuperclass()));
+ }
+ if (typeInheritanceMapOpen) {
+ outWriter.print(" }");
+ }
+ }
+
// add any pending locale definitions requested by the client
printLocaleDeclarations(outWriter);
diff --git a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
index 56f72b2cd7..1b79f6e5b0 100644
--- a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
+++ b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java
@@ -4,23 +4,15 @@
package com.vaadin.terminal.gwt.server;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.Serializable;
-import java.io.StringWriter;
import java.util.Collection;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
import java.util.Stack;
import java.util.Vector;
-import java.util.logging.Level;
import java.util.logging.Logger;
import com.vaadin.Application;
@@ -35,9 +27,7 @@ import com.vaadin.terminal.ThemeResource;
import com.vaadin.terminal.VariableOwner;
import com.vaadin.terminal.gwt.client.Connector;
import com.vaadin.ui.Alignment;
-import com.vaadin.ui.ClientWidget;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Root;
/**
* User Interface Description Language Target.
@@ -86,7 +76,7 @@ public class JsonPaintTarget implements PaintTarget {
private final Collection<Paintable> paintedComponents = new HashSet<Paintable>();
- private final Collection<Class<? extends Paintable>> usedPaintableTypes = new LinkedList<Class<? extends Paintable>>();
+ private final Set<Class<? extends ClientConnector>> usedClientConnectors = new HashSet<Class<? extends ClientConnector>>();
/**
* Creates a new JsonPaintTarget.
@@ -988,159 +978,27 @@ public class JsonPaintTarget implements PaintTarget {
return usedResources;
}
- private static final Map<Class<? extends Paintable>, Class<? extends Paintable>> widgetMappingCache = new HashMap<Class<? extends Paintable>, Class<? extends Paintable>>();
-
@SuppressWarnings("unchecked")
public String getTag(Paintable paintable) {
- Class<? extends Paintable> class1;
- synchronized (widgetMappingCache) {
- class1 = widgetMappingCache.get(paintable.getClass());
+ if (!(paintable instanceof ClientConnector)) {
+ throw new IllegalArgumentException(
+ "Tags are only available for ClientConnectors");
}
- if (class1 == null) {
- /*
- * Client widget annotation is searched from component hierarchy to
- * detect the component that presumably has client side
- * implementation. The server side name is used in the
- * transportation, but encoded into integer strings to optimized
- * transferred data.
- */
- class1 = paintable.getClass();
- while (!hasClientWidgetMapping(class1)) {
- Class<?> superclass = class1.getSuperclass();
- if (superclass != null
- && Paintable.class.isAssignableFrom(superclass)) {
- class1 = (Class<? extends Paintable>) superclass;
- } else {
- logger.warning("No superclass of "
- + paintable.getClass().getName()
- + " has a @ClientWidget"
- + " annotation. Component will not be mapped correctly on client side.");
- break;
- }
- }
- synchronized (widgetMappingCache) {
- widgetMappingCache.put(paintable.getClass(), class1);
- }
- }
-
- usedPaintableTypes.add(class1);
- return manager.getTagForType((Class<? extends ClientConnector>) class1);
-
- }
-
- private boolean hasClientWidgetMapping(Class<? extends Paintable> class1) {
- if (Root.class == class1) {
- return true;
+ Class<?> clazz = paintable.getClass();
+ while (!usedClientConnectors.contains(clazz)
+ && clazz.getSuperclass() != null
+ && ClientConnector.class
+ .isAssignableFrom(clazz.getSuperclass())) {
+ usedClientConnectors.add((Class<? extends ClientConnector>) clazz);
+ clazz = clazz.getSuperclass();
}
- try {
- return class1.isAnnotationPresent(ClientWidget.class);
- } catch (NoClassDefFoundError e) {
- String stacktrace = getStacktraceString(e);
- if (stacktrace
- .contains("com.ibm.oti.reflect.AnnotationParser.parseClass")) {
- // #7479 IBM JVM apparently tries to eagerly load the classes
- // referred to by annotations. Checking the annotation from byte
- // code to be sure that we are dealing the this case and not
- // some other class loading issue.
- if (bytecodeContainsClientWidgetAnnotation(class1)) {
- return true;
- }
- } else {
- // throw exception forward
- throw e;
- }
- } catch (LinkageError e) {
- String stacktrace = getStacktraceString(e);
- if (stacktrace
- .contains("org.jboss.modules.ModuleClassLoader.defineClass")) {
- // #7822 JBoss AS 7 apparently tries to eagerly load the classes
- // referred to by annotations. Checking the annotation from byte
- // code to be sure that we are dealing the this case and not
- // some other class loading issue.
- if (bytecodeContainsClientWidgetAnnotation(class1)) {
- // Seems that JBoss still prints a stacktrace to the logs
- // even though the LinkageError has been caught
- return true;
- }
- } else {
- // throw exception forward
- throw e;
- }
- } catch (RuntimeException e) {
- if (e.getStackTrace()[0].getClassName().equals(
- "org.glassfish.web.loader.WebappClassLoader")) {
-
- // See #3920
- // Glassfish 3 is darn eager to load the value class, even
- // though we just want to check if the annotation exists.
-
- // In some situations (depending on class loading order) it
- // would be enough to return true here, but it is safer to check
- // the annotation from byte code
-
- if (bytecodeContainsClientWidgetAnnotation(class1)) {
- return true;
- }
- } else {
- // throw exception forward
- throw e;
- }
- }
- return false;
- }
-
- private static String getStacktraceString(Throwable e) {
- StringWriter writer = new StringWriter();
- e.printStackTrace(new PrintWriter(writer));
- String stacktrace = writer.toString();
- return stacktrace;
- }
-
- private boolean bytecodeContainsClientWidgetAnnotation(
- Class<? extends Paintable> class1) {
-
- try {
- String name = class1.getName().replace('.', '/') + ".class";
-
- InputStream stream = class1.getClassLoader().getResourceAsStream(
- name);
- BufferedReader bufferedReader = new BufferedReader(
- new InputStreamReader(stream));
- try {
- String line;
- boolean atSourcefile = false;
- while ((line = bufferedReader.readLine()) != null) {
- if (line.startsWith("SourceFile")) {
- atSourcefile = true;
- }
- if (atSourcefile) {
- if (line.contains("ClientWidget")) {
- return true;
- }
- }
- // TODO could optimize to quit at the end attribute
- }
- } catch (IOException e1) {
- logger.log(Level.SEVERE,
- "An error occurred while finding widget mapping.", e1);
- } finally {
- try {
- bufferedReader.close();
- } catch (IOException e1) {
- logger.log(Level.SEVERE, "Could not close reader.", e1);
-
- }
- }
- } catch (Throwable t) {
- logger.log(Level.SEVERE,
- "An error occurred while finding widget mapping.", t);
- }
-
- return false;
+ return manager
+ .getTagForType((Class<? extends ClientConnector>) paintable
+ .getClass());
}
- Collection<Class<? extends Paintable>> getUsedPaintableTypes() {
- return usedPaintableTypes;
+ Collection<Class<? extends ClientConnector>> getUsedClientConnectors() {
+ return usedClientConnectors;
}
public void addVariable(VariableOwner owner, String name,
diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java
index ae744aa4f8..d1b554c358 100644
--- a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java
+++ b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java
@@ -32,8 +32,6 @@ import java.util.logging.Logger;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.ClientCriterion;
import com.vaadin.terminal.Paintable;
-import com.vaadin.ui.ClientWidget;
-import com.vaadin.ui.Root;
/**
* Utility class to collect widgetset related information from classpath.
@@ -94,8 +92,8 @@ public class ClassPathExplorer {
}
/**
- * Finds server side widgets with {@link ClientWidget} annotation on the
- * class path (entries that can contain widgets/widgetsets - see
+ * Finds server side widgets with ClientWidget annotation on the class path
+ * (entries that can contain widgets/widgetsets - see
* getRawClasspathEntries()).
*
* As a side effect, also accept criteria are searched under the same class
@@ -450,7 +448,7 @@ public class ClassPathExplorer {
/**
* Searches for all paintable classes and accept criteria under a location
- * based on {@link ClientWidget} and {@link ClientCriterion} annotations.
+ * based on {@link ClientCriterion} annotations.
*
* Note that client criteria are updated directly to the
* {@link #acceptCriterion} field, whereas paintables are added to the
@@ -543,13 +541,13 @@ public class ClassPathExplorer {
private static Set<Class<? extends AcceptCriterion>> acceptCriterion = new HashSet<Class<? extends AcceptCriterion>>();
/**
- * Checks a class for the {@link ClientWidget} and {@link ClientCriterion}
- * annotations, and adds it to the appropriate collection if it has either.
+ * Checks a class for the {@link ClientCriterion} annotations, and adds it
+ * to the appropriate collection if it has either.
*
* @param fullclassName
* @param paintables
* the collection to which to add server side classes with
- * {@link ClientWidget} annotation
+ * {@link ClientCriterion} annotation
*/
@SuppressWarnings("unchecked")
private static void tryToAdd(final String fullclassName,
@@ -564,10 +562,7 @@ public class ClassPathExplorer {
Class<?> c = Class.forName(fullclassName);
- if (c.getAnnotation(ClientWidget.class) != null || Root.class == c) {
- paintables.add((Class<? extends Paintable>) c);
- // System.out.println("Found paintable " + fullclassName);
- } else if (c.getAnnotation(ClientCriterion.class) != null) {
+ if (c.getAnnotation(ClientCriterion.class) != null) {
acceptCriterion.add((Class<? extends AcceptCriterion>) c);
}
} catch (UnsupportedClassVersionError e) {
diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/CustomWidgetMapGenerator.java b/src/com/vaadin/terminal/gwt/widgetsetutils/CustomWidgetMapGenerator.java
index 4ea4cbb8fe..9d5f48a276 100644
--- a/src/com/vaadin/terminal/gwt/widgetsetutils/CustomWidgetMapGenerator.java
+++ b/src/com/vaadin/terminal/gwt/widgetsetutils/CustomWidgetMapGenerator.java
@@ -6,57 +6,57 @@ package com.vaadin.terminal.gwt.widgetsetutils;
import java.util.Collection;
import java.util.HashSet;
-import com.vaadin.terminal.Paintable;
-import com.vaadin.ui.ClientWidget;
-import com.vaadin.ui.ClientWidget.LoadStyle;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.Component;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
/**
* An abstract helper class that can be used to easily build a widgetset with
* customized load styles for each components. In three abstract methods one can
- * override the default values given in {@link ClientWidget} annotations.
+ * override the default values given in {@link Component} annotations.
*
* @see WidgetMapGenerator
*
*/
public abstract class CustomWidgetMapGenerator extends WidgetMapGenerator {
- private Collection<Class<? extends Paintable>> eagerPaintables = new HashSet<Class<? extends Paintable>>();
- private Collection<Class<? extends Paintable>> lazyPaintables = new HashSet<Class<? extends Paintable>>();
- private Collection<Class<? extends Paintable>> deferredPaintables = new HashSet<Class<? extends Paintable>>();
+ private Collection<Class<? extends ComponentConnector>> eagerPaintables = new HashSet<Class<? extends ComponentConnector>>();
+ private Collection<Class<? extends ComponentConnector>> lazyPaintables = new HashSet<Class<? extends ComponentConnector>>();
+ private Collection<Class<? extends ComponentConnector>> deferredPaintables = new HashSet<Class<? extends ComponentConnector>>();
@Override
- protected LoadStyle getLoadStyle(Class<? extends Paintable> paintableType) {
+ protected LoadStyle getLoadStyle(Class<? extends ComponentConnector> connector) {
if (eagerPaintables == null) {
init();
}
- if (eagerPaintables.contains(paintableType)) {
+ if (eagerPaintables.contains(connector)) {
return LoadStyle.EAGER;
}
- if (lazyPaintables.contains(paintableType)) {
+ if (lazyPaintables.contains(connector)) {
return LoadStyle.LAZY;
}
- if (deferredPaintables.contains(paintableType)) {
+ if (deferredPaintables.contains(connector)) {
return LoadStyle.DEFERRED;
}
- return super.getLoadStyle(paintableType);
+ return super.getLoadStyle(connector);
}
private void init() {
- Class<? extends Paintable>[] eagerComponents = getEagerComponents();
+ Class<? extends ComponentConnector>[] eagerComponents = getEagerComponents();
if (eagerComponents != null) {
- for (Class<? extends Paintable> class1 : eagerComponents) {
+ for (Class<? extends ComponentConnector> class1 : eagerComponents) {
eagerPaintables.add(class1);
}
}
- Class<? extends Paintable>[] lazyComponents = getEagerComponents();
+ Class<? extends ComponentConnector>[] lazyComponents = getEagerComponents();
if (lazyComponents != null) {
- for (Class<? extends Paintable> class1 : lazyComponents) {
+ for (Class<? extends ComponentConnector> class1 : lazyComponents) {
lazyPaintables.add(class1);
}
}
- Class<? extends Paintable>[] deferredComponents = getEagerComponents();
+ Class<? extends ComponentConnector>[] deferredComponents = getEagerComponents();
if (deferredComponents != null) {
- for (Class<? extends Paintable> class1 : deferredComponents) {
+ for (Class<? extends ComponentConnector> class1 : deferredComponents) {
deferredPaintables.add(class1);
}
}
@@ -66,18 +66,18 @@ public abstract class CustomWidgetMapGenerator extends WidgetMapGenerator {
* @return an array of components whose load style should be overridden to
* {@link LoadStyle#EAGER}
*/
- protected abstract Class<? extends Paintable>[] getEagerComponents();
+ protected abstract Class<? extends ComponentConnector>[] getEagerComponents();
/**
* @return an array of components whose load style should be overridden to
* {@link LoadStyle#LAZY}
*/
- protected abstract Class<? extends Paintable>[] getLazyComponents();
+ protected abstract Class<? extends ComponentConnector>[] getLazyComponents();
/**
* @return an array of components whose load style should be overridden to
* {@link LoadStyle#DEFERRED}
*/
- protected abstract Class<? extends Paintable>[] getDeferredComponents();
+ protected abstract Class<? extends ComponentConnector>[] getDeferredComponents();
}
diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/EagerWidgetMapGenerator.java b/src/com/vaadin/terminal/gwt/widgetsetutils/EagerWidgetMapGenerator.java
index 6381a3b4cb..6e20169c3b 100644
--- a/src/com/vaadin/terminal/gwt/widgetsetutils/EagerWidgetMapGenerator.java
+++ b/src/com/vaadin/terminal/gwt/widgetsetutils/EagerWidgetMapGenerator.java
@@ -3,8 +3,8 @@
*/
package com.vaadin.terminal.gwt.widgetsetutils;
-import com.vaadin.terminal.Paintable;
-import com.vaadin.ui.ClientWidget.LoadStyle;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
/**
* WidgetMap generator that builds a widgetset that packs all included widgets
@@ -21,8 +21,10 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
*
*/
public class EagerWidgetMapGenerator extends WidgetMapGenerator {
- @Override
- protected LoadStyle getLoadStyle(Class<? extends Paintable> paintableType) {
- return LoadStyle.EAGER;
+
+
+ @Override
+ protected LoadStyle getLoadStyle(Class<? extends ComponentConnector> connector) {
+ return LoadStyle.EAGER;
}
}
diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/LazyWidgetMapGenerator.java b/src/com/vaadin/terminal/gwt/widgetsetutils/LazyWidgetMapGenerator.java
index 7de72f09ce..28f9f8a84f 100644
--- a/src/com/vaadin/terminal/gwt/widgetsetutils/LazyWidgetMapGenerator.java
+++ b/src/com/vaadin/terminal/gwt/widgetsetutils/LazyWidgetMapGenerator.java
@@ -3,8 +3,9 @@
*/
package com.vaadin.terminal.gwt.widgetsetutils;
-import com.vaadin.terminal.Paintable;
-import com.vaadin.ui.ClientWidget.LoadStyle;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
+
/**
* WidgetMap generator that builds a widgetset that optimizes the transferred
@@ -16,7 +17,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
*/
public class LazyWidgetMapGenerator extends WidgetMapGenerator {
@Override
- protected LoadStyle getLoadStyle(Class<? extends Paintable> paintableType) {
+ protected LoadStyle getLoadStyle(Class<? extends ComponentConnector> connector) {
return LoadStyle.LAZY;
}
diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java b/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java
index 266b919c86..8552168753 100644
--- a/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java
+++ b/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java
@@ -22,21 +22,20 @@ import com.google.gwt.core.ext.typeinfo.JClassType;
import com.google.gwt.core.ext.typeinfo.TypeOracle;
import com.google.gwt.user.rebind.ClassSourceFileComposerFactory;
import com.google.gwt.user.rebind.SourceWriter;
-import com.vaadin.terminal.Paintable;
import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.Connector;
+import com.vaadin.terminal.gwt.client.ui.Component;
+import com.vaadin.terminal.gwt.client.ui.Component.LoadStyle;
import com.vaadin.terminal.gwt.client.ui.RootConnector;
import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector;
-import com.vaadin.ui.ClientWidget;
-import com.vaadin.ui.ClientWidget.LoadStyle;
-import com.vaadin.ui.Root;
+import com.vaadin.terminal.gwt.server.ClientConnector;
/**
* WidgetMapGenerator's are GWT generator to build WidgetMapImpl dynamically
- * based on {@link ClientWidget} annotations available in workspace. By
- * modifying the generator it is possible to do some fine tuning for the
- * generated widgetset (aka client side engine). The components to be included
- * in the client side engine can modified be overriding
- * {@link #getUsedPaintables()}.
+ * based on {@link Component} annotations available in workspace. By modifying
+ * the generator it is possible to do some fine tuning for the generated
+ * widgetset (aka client side engine). The components to be included in the
+ * client side engine can modified be overriding {@link #getUsedConnectors()}.
* <p>
* The generator also decides how the client side component implementations are
* loaded to the browser. The default generator is
@@ -44,7 +43,7 @@ import com.vaadin.ui.Root;
* that loads all widget implementation on application initialization. This has
* been the only option until Vaadin 6.4.
* <p>
- * This generator uses the loadStyle hints from the {@link ClientWidget}
+ * This generator uses the loadStyle hints from the {@link Component}
* annotations. Depending on the {@link LoadStyle} used, the widget may be
* included in the initially loaded JavaScript, loaded when the application has
* started and there is no communication to server or lazy loaded when the
@@ -72,7 +71,7 @@ import com.vaadin.ui.Root;
*/
public class WidgetMapGenerator extends Generator {
- private static String paintableClassName = ComponentConnector.class
+ private static String componentConnectorClassName = ComponentConnector.class
.getName();
private String packageName;
@@ -129,15 +128,15 @@ public class WidgetMapGenerator extends Generator {
SourceWriter sourceWriter = composer.createSourceWriter(context,
printWriter);
- Collection<Class<? extends Paintable>> paintablesHavingWidgetAnnotation = getUsedPaintables();
+ Collection<Class<? extends ComponentConnector>> connectors = getUsedConnectors(context
+ .getTypeOracle());
- validatePaintables(logger, context, paintablesHavingWidgetAnnotation);
+ validateConnectors(logger, connectors);
+ logConnectors(logger, context, connectors);
// generator constructor source code
- generateImplementationDetector(sourceWriter,
- paintablesHavingWidgetAnnotation);
- generateInstantiatorMethod(sourceWriter,
- paintablesHavingWidgetAnnotation);
+ generateImplementationDetector(sourceWriter, connectors);
+ generateInstantiatorMethod(sourceWriter, connectors);
// close generated class
sourceWriter.outdent();
sourceWriter.println("}");
@@ -149,45 +148,44 @@ public class WidgetMapGenerator extends Generator {
}
- /**
- * Verifies that all client side components are available for client side
- * GWT module.
- *
- * @param logger
- * @param context
- * @param paintablesHavingWidgetAnnotation
- */
- private void validatePaintables(
- TreeLogger logger,
- GeneratorContext context,
- Collection<Class<? extends Paintable>> paintablesHavingWidgetAnnotation) {
- TypeOracle typeOracle = context.getTypeOracle();
-
- for (Iterator<Class<? extends Paintable>> iterator = paintablesHavingWidgetAnnotation
- .iterator(); iterator.hasNext();) {
- Class<? extends Paintable> class1 = iterator.next();
-
- Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass = getClientClass(class1);
- if (typeOracle.findType(clientClass.getName()) == null) {
- // GWT widget not inherited
- logger.log(Type.WARN, "Widget class " + clientClass.getName()
- + " was not found. The component " + class1.getName()
- + " will not be included in the widgetset.");
- iterator.remove();
+ private void validateConnectors(TreeLogger logger,
+ Collection<Class<? extends ComponentConnector>> connectors) {
+
+ Iterator<Class<? extends ComponentConnector>> iter = connectors
+ .iterator();
+ while (iter.hasNext()) {
+ Class<? extends ComponentConnector> connectorClass = iter.next();
+ Component annotation = connectorClass
+ .getAnnotation(Component.class);
+ if (!ClientConnector.class.isAssignableFrom(annotation.value())) {
+ logger.log(
+ Type.WARN,
+ "Connector class "
+ + annotation.value().getName()
+ + " defined in @Component annotation is not a subclass of "
+ + ClientConnector.class.getName()
+ + ". The component connector "
+ + connectorClass.getName()
+ + " will not be included in the widgetset.");
+ iter.remove();
}
-
}
+
+ }
+
+ private void logConnectors(TreeLogger logger, GeneratorContext context,
+ Collection<Class<? extends ComponentConnector>> connectors) {
logger.log(Type.INFO,
- "Widget set will contain implementations for following components: ");
+ "Widget set will contain implementations for following component connectors: ");
TreeSet<String> classNames = new TreeSet<String>();
HashMap<String, String> loadStyle = new HashMap<String, String>();
- for (Class<? extends Paintable> class1 : paintablesHavingWidgetAnnotation) {
- String className = class1.getCanonicalName();
+ for (Class<? extends ComponentConnector> connectorClass : connectors) {
+ String className = connectorClass.getCanonicalName();
classNames.add(className);
- if (getLoadStyle(class1) == LoadStyle.DEFERRED) {
+ if (getLoadStyle(connectorClass) == LoadStyle.DEFERRED) {
loadStyle.put(className, "DEFERRED");
- } else if (getLoadStyle(class1) == LoadStyle.LAZY) {
+ } else if (getLoadStyle(connectorClass) == LoadStyle.LAZY) {
loadStyle.put(className, "LAZY");
}
@@ -210,36 +208,50 @@ public class WidgetMapGenerator extends Generator {
* @return a collections of Vaadin components that will be added to
* widgetset
*/
- protected Collection<Class<? extends Paintable>> getUsedPaintables() {
- return ClassPathExplorer.getPaintablesHavingWidgetAnnotation();
+ @SuppressWarnings("unchecked")
+ private Collection<Class<? extends ComponentConnector>> getUsedConnectors(
+ TypeOracle typeOracle) {
+ JClassType connectorType = typeOracle.findType(Connector.class
+ .getName());
+ Collection<Class<? extends ComponentConnector>> connectors = new HashSet<Class<? extends ComponentConnector>>();
+ for (JClassType jClassType : connectorType.getSubtypes()) {
+ Component annotation = jClassType.getAnnotation(Component.class);
+ if (annotation != null) {
+ try {
+ Class<? extends ComponentConnector> clazz = (Class<? extends ComponentConnector>) Class
+ .forName(jClassType.getQualifiedSourceName());
+ connectors.add(clazz);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+ return connectors;
}
/**
* Returns true if the widget for given component will be lazy loaded by the
* client. The default implementation reads the information from the
- * {@link ClientWidget} annotation.
+ * {@link Component} annotation.
* <p>
* The method can be overridden to optimize the widget loading mechanism. If
* the Widgetset is wanted to be optimized for a network with a high latency
* or for a one with a very fast throughput, it may be good to return false
* for every component.
*
- * @param paintableType
+ * @param connector
* @return true iff the widget for given component should be lazy loaded by
* the client side engine
*/
- protected LoadStyle getLoadStyle(Class<? extends Paintable> paintableType) {
- if (Root.class == paintableType) {
- return LoadStyle.EAGER;
- }
- ClientWidget annotation = paintableType
- .getAnnotation(ClientWidget.class);
+ protected LoadStyle getLoadStyle(
+ Class<? extends ComponentConnector> connector) {
+ Component annotation = connector.getAnnotation(Component.class);
return annotation.loadStyle();
}
private void generateInstantiatorMethod(
SourceWriter sourceWriter,
- Collection<Class<? extends Paintable>> paintablesHavingWidgetAnnotation) {
+ Collection<Class<? extends ComponentConnector>> connectorsHavingComponentAnnotation) {
Collection<Class<?>> deferredWidgets = new LinkedList<Class<?>>();
@@ -247,17 +259,17 @@ public class WidgetMapGenerator extends Generator {
// lookup with index than with the hashmap
sourceWriter.println("public void ensureInstantiator(Class<? extends "
- + paintableClassName + "> classType) {");
+ + componentConnectorClassName + "> classType) {");
sourceWriter.println("if(!instmap.containsKey(classType)){");
boolean first = true;
- ArrayList<Class<? extends Paintable>> lazyLoadedWidgets = new ArrayList<Class<? extends Paintable>>();
+ ArrayList<Class<? extends ComponentConnector>> lazyLoadedWidgets = new ArrayList<Class<? extends ComponentConnector>>();
- HashSet<Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector>> widgetsWithInstantiator = new HashSet<Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector>>();
+ HashSet<Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector>> connectorsWithInstantiator = new HashSet<Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector>>();
- for (Class<? extends Paintable> class1 : paintablesHavingWidgetAnnotation) {
- Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass = getClientClass(class1);
- if (widgetsWithInstantiator.contains(clientClass)) {
+ for (Class<? extends ComponentConnector> class1 : connectorsHavingComponentAnnotation) {
+ Class<? extends ComponentConnector> clientClass = class1;
+ if (connectorsWithInstantiator.contains(clientClass)) {
continue;
}
if (clientClass == RootConnector.class) {
@@ -273,8 +285,9 @@ public class WidgetMapGenerator extends Generator {
+ ".class) {");
String instantiator = "new WidgetInstantiator() {\n public "
- + paintableClassName + " get() {\n return GWT.create("
- + clientClass.getName() + ".class );\n}\n}\n";
+ + componentConnectorClassName
+ + " get() {\n return GWT.create(" + clientClass.getName()
+ + ".class );\n}\n}\n";
LoadStyle loadStyle = getLoadStyle(class1);
@@ -301,14 +314,15 @@ public class WidgetMapGenerator extends Generator {
sourceWriter.print(");");
}
sourceWriter.print("}");
- widgetsWithInstantiator.add(clientClass);
+ connectorsWithInstantiator.add(clientClass);
}
sourceWriter.println("}");
sourceWriter.println("}");
- sourceWriter.println("public Class<? extends " + paintableClassName
+ sourceWriter.println("public Class<? extends "
+ + componentConnectorClassName
+ ">[] getDeferredLoadedWidgets() {");
sourceWriter.println("return new Class[] {");
@@ -318,10 +332,7 @@ public class WidgetMapGenerator extends Generator {
sourceWriter.println(",");
}
first = false;
- ClientWidget annotation = class2.getAnnotation(ClientWidget.class);
- Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> value = annotation
- .value();
- sourceWriter.print(value.getName() + ".class");
+ sourceWriter.print(class2.getName() + ".class");
}
sourceWriter.println("};");
@@ -334,11 +345,11 @@ public class WidgetMapGenerator extends Generator {
// TODO an index of last ensured widget in array
- sourceWriter.println("public " + paintableClassName
- + " instantiate(Class<? extends " + paintableClassName
+ sourceWriter.println("public " + componentConnectorClassName
+ + " instantiate(Class<? extends " + componentConnectorClassName
+ "> classType) {");
sourceWriter.indent();
- sourceWriter.println(paintableClassName
+ sourceWriter.println(componentConnectorClassName
+ " p = super.instantiate(classType); if(p!= null) return p;");
sourceWriter.println("return instmap.get(classType).get();");
@@ -355,23 +366,23 @@ public class WidgetMapGenerator extends Generator {
*/
private void generateImplementationDetector(
SourceWriter sourceWriter,
- Collection<Class<? extends Paintable>> paintablesHavingWidgetAnnotation) {
+ Collection<Class<? extends ComponentConnector>> paintablesHavingWidgetAnnotation) {
sourceWriter
.println("public Class<? extends "
- + paintableClassName
+ + componentConnectorClassName
+ "> "
- + "getImplementationByServerSideClassName(String fullyQualifiedName) {");
+ + "getConnectorClassForServerSideClassName(String fullyQualifiedName) {");
sourceWriter.indent();
sourceWriter
.println("fullyQualifiedName = fullyQualifiedName.intern();");
- for (Class<? extends Paintable> class1 : paintablesHavingWidgetAnnotation) {
- Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass = getClientClass(class1);
+ for (Class<? extends ComponentConnector> connectorClass : paintablesHavingWidgetAnnotation) {
+ Class<? extends ClientConnector> clientConnectorClass = getClientConnectorClass(connectorClass);
sourceWriter.print("if ( fullyQualifiedName == \"");
- sourceWriter.print(class1.getName());
+ sourceWriter.print(clientConnectorClass.getName());
sourceWriter.print("\" ) { ensureInstantiator("
- + clientClass.getName() + ".class); return ");
- sourceWriter.print(clientClass.getName());
+ + connectorClass.getName() + ".class); return ");
+ sourceWriter.print(connectorClass.getName());
sourceWriter.println(".class;}");
sourceWriter.print("else ");
}
@@ -382,15 +393,9 @@ public class WidgetMapGenerator extends Generator {
}
- private static Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> getClientClass(
- Class<? extends Paintable> class1) {
- Class<? extends com.vaadin.terminal.gwt.client.ComponentConnector> clientClass;
- if (Root.class == class1) {
- clientClass = RootConnector.class;
- } else {
- ClientWidget annotation = class1.getAnnotation(ClientWidget.class);
- clientClass = annotation.value();
- }
- return clientClass;
+ private static Class<? extends ClientConnector> getClientConnectorClass(
+ Class<? extends ComponentConnector> connectorClass) {
+ Component annotation = connectorClass.getAnnotation(Component.class);
+ return (Class<? extends ClientConnector>) annotation.value();
}
}
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java
index f1dc6ba732..20ef7e38cc 100644
--- a/src/com/vaadin/ui/AbsoluteLayout.java
+++ b/src/com/vaadin/ui/AbsoluteLayout.java
@@ -28,7 +28,6 @@ import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
*
*/
@SuppressWarnings("serial")
-@ClientWidget(AbsoluteLayoutConnector.class)
public class AbsoluteLayout extends AbstractLayout implements
LayoutClickNotifier {
diff --git a/src/com/vaadin/ui/Accordion.java b/src/com/vaadin/ui/Accordion.java
index 7efc2d47ec..b937c7bc2b 100644
--- a/src/com/vaadin/ui/Accordion.java
+++ b/src/com/vaadin/ui/Accordion.java
@@ -3,8 +3,6 @@
*/
package com.vaadin.ui;
-import com.vaadin.terminal.gwt.client.ui.AccordionConnector;
-
/**
* An accordion is a component similar to a {@link TabSheet}, but with a
* vertical orientation and the selected component presented between tabs.
@@ -16,7 +14,6 @@ import com.vaadin.terminal.gwt.client.ui.AccordionConnector;
*
* @see TabSheet
*/
-@ClientWidget(AccordionConnector.class)
public class Accordion extends TabSheet {
}
diff --git a/src/com/vaadin/ui/Audio.java b/src/com/vaadin/ui/Audio.java
index 9759b130f6..ac2ee869a6 100644
--- a/src/com/vaadin/ui/Audio.java
+++ b/src/com/vaadin/ui/Audio.java
@@ -5,7 +5,6 @@
package com.vaadin.ui;
import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.gwt.client.ui.AudioConnector;
/**
* The Audio component translates into an HTML5 &lt;audio&gt; element and as
@@ -28,7 +27,6 @@ import com.vaadin.terminal.gwt.client.ui.AudioConnector;
* @author Vaadin Ltd
* @since 6.7.0
*/
-@ClientWidget(AudioConnector.class)
public class Audio extends AbstractMedia {
public Audio() {
diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java
index dbebd9200c..fc564c3237 100644
--- a/src/com/vaadin/ui/Button.java
+++ b/src/com/vaadin/ui/Button.java
@@ -20,11 +20,9 @@ import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.event.ShortcutListener;
import com.vaadin.terminal.gwt.client.ComponentState;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ui.ButtonConnector;
import com.vaadin.terminal.gwt.client.ui.ButtonConnector.ButtonServerRpc;
import com.vaadin.terminal.gwt.client.ui.ButtonState;
import com.vaadin.tools.ReflectTools;
-import com.vaadin.ui.ClientWidget.LoadStyle;
import com.vaadin.ui.Component.Focusable;
/**
@@ -36,7 +34,6 @@ import com.vaadin.ui.Component.Focusable;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(value = ButtonConnector.class, loadStyle = LoadStyle.EAGER)
public class Button extends AbstractComponent implements
FieldEvents.BlurNotifier, FieldEvents.FocusNotifier, Focusable,
Action.ShortcutNotifier {
diff --git a/src/com/vaadin/ui/CheckBox.java b/src/com/vaadin/ui/CheckBox.java
index 8cc4a7f1eb..f51110755e 100644
--- a/src/com/vaadin/ui/CheckBox.java
+++ b/src/com/vaadin/ui/CheckBox.java
@@ -13,10 +13,8 @@ import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.CheckBoxConnector;
import com.vaadin.terminal.gwt.client.ui.VCheckBox;
-@ClientWidget(CheckBoxConnector.class)
public class CheckBox extends AbstractField<Boolean> {
/**
* Creates a new checkbox.
diff --git a/src/com/vaadin/ui/ComboBox.java b/src/com/vaadin/ui/ComboBox.java
index 60349b0a43..46f78ac7d5 100644
--- a/src/com/vaadin/ui/ComboBox.java
+++ b/src/com/vaadin/ui/ComboBox.java
@@ -9,7 +9,6 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.ComboBoxConnector;
import com.vaadin.terminal.gwt.client.ui.VFilterSelect;
/**
@@ -21,7 +20,6 @@ import com.vaadin.terminal.gwt.client.ui.VFilterSelect;
*
*/
@SuppressWarnings("serial")
-@ClientWidget(ComboBoxConnector.class)
public class ComboBox extends Select {
private String inputPrompt = null;
diff --git a/src/com/vaadin/ui/CssLayout.java b/src/com/vaadin/ui/CssLayout.java
index 1b3f5306eb..a0ff86e3be 100644
--- a/src/com/vaadin/ui/CssLayout.java
+++ b/src/com/vaadin/ui/CssLayout.java
@@ -60,7 +60,6 @@ import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
* @since 6.1 brought in from "FastLayouts" incubator project
*
*/
-@ClientWidget(CssLayoutConnector.class)
public class CssLayout extends AbstractLayout implements LayoutClickNotifier {
private CssLayoutServerRPC rpc = new CssLayoutServerRPC() {
diff --git a/src/com/vaadin/ui/CustomComponent.java b/src/com/vaadin/ui/CustomComponent.java
index 691c9d3c32..98d650f6db 100644
--- a/src/com/vaadin/ui/CustomComponent.java
+++ b/src/com/vaadin/ui/CustomComponent.java
@@ -7,9 +7,6 @@ package com.vaadin.ui;
import java.io.Serializable;
import java.util.Iterator;
-import com.vaadin.terminal.gwt.client.ui.CustomComponentConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
-
/**
* Custom component provides simple implementation of Component interface for
* creation of new UI components by composition of existing components.
@@ -25,7 +22,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(value = CustomComponentConnector.class, loadStyle = LoadStyle.EAGER)
public class CustomComponent extends AbstractComponentContainer {
/**
diff --git a/src/com/vaadin/ui/CustomField.java b/src/com/vaadin/ui/CustomField.java
index 67063db95e..c333309fbf 100644
--- a/src/com/vaadin/ui/CustomField.java
+++ b/src/com/vaadin/ui/CustomField.java
@@ -11,7 +11,6 @@ import java.util.Iterator;
import com.vaadin.data.Property;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.CustomComponentConnector;
/**
* A {@link Field} whose UI content can be constructed by the user, enabling the
@@ -35,7 +34,6 @@ import com.vaadin.terminal.gwt.client.ui.CustomComponentConnector;
*
* @since 7.0
*/
-@ClientWidget(CustomComponentConnector.class)
public abstract class CustomField<T> extends AbstractField<T> implements
ComponentContainer {
diff --git a/src/com/vaadin/ui/CustomLayout.java b/src/com/vaadin/ui/CustomLayout.java
index a97a317b9d..cb0cf25e6f 100644
--- a/src/com/vaadin/ui/CustomLayout.java
+++ b/src/com/vaadin/ui/CustomLayout.java
@@ -12,7 +12,6 @@ import java.util.Iterator;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.CustomLayoutConnector;
/**
* <p>
@@ -44,7 +43,6 @@ import com.vaadin.terminal.gwt.client.ui.CustomLayoutConnector;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(CustomLayoutConnector.class)
public class CustomLayout extends AbstractLayout {
private static final int BUFFER_SIZE = 10000;
diff --git a/src/com/vaadin/ui/DateField.java b/src/com/vaadin/ui/DateField.java
index 4e6be98f7a..311019c2e4 100644
--- a/src/com/vaadin/ui/DateField.java
+++ b/src/com/vaadin/ui/DateField.java
@@ -26,7 +26,6 @@ import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.PopupDateFieldConnector;
import com.vaadin.terminal.gwt.client.ui.VDateField;
/**
@@ -50,7 +49,6 @@ import com.vaadin.terminal.gwt.client.ui.VDateField;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(PopupDateFieldConnector.class)
public class DateField extends AbstractField<Date> implements
FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
diff --git a/src/com/vaadin/ui/DragAndDropWrapper.java b/src/com/vaadin/ui/DragAndDropWrapper.java
index dcefc545d9..937942f3d3 100644
--- a/src/com/vaadin/ui/DragAndDropWrapper.java
+++ b/src/com/vaadin/ui/DragAndDropWrapper.java
@@ -21,13 +21,11 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.StreamVariable;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ui.DragAndDropWrapperConnector;
import com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper;
import com.vaadin.terminal.gwt.client.ui.dd.HorizontalDropLocation;
import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
@SuppressWarnings("serial")
-@ClientWidget(DragAndDropWrapperConnector.class)
public class DragAndDropWrapper extends CustomComponent implements DropTarget,
DragSource {
diff --git a/src/com/vaadin/ui/Embedded.java b/src/com/vaadin/ui/Embedded.java
index b936a62471..688176fb3e 100644
--- a/src/com/vaadin/ui/Embedded.java
+++ b/src/com/vaadin/ui/Embedded.java
@@ -27,7 +27,6 @@ import com.vaadin.terminal.gwt.client.ui.EmbeddedConnector.EmbeddedServerRPC;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(EmbeddedConnector.class)
public class Embedded extends AbstractComponent {
/**
diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java
index a66c8e723b..74607b65d0 100644
--- a/src/com/vaadin/ui/Form.java
+++ b/src/com/vaadin/ui/Form.java
@@ -30,7 +30,6 @@ import com.vaadin.terminal.ErrorMessage;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.UserError;
-import com.vaadin.terminal.gwt.client.ui.FormConnector;
/**
* Form component provides easy way of creating and managing sets fields.
@@ -65,7 +64,6 @@ import com.vaadin.terminal.gwt.client.ui.FormConnector;
* @deprecated Use {@link FieldGroup} instead of {@link Form} for more
* flexibility.
*/
-@ClientWidget(FormConnector.class)
@Deprecated
public class Form extends AbstractField<Object> implements Item.Editor,
Buffered, Item, Validatable, Action.Notifier, HasComponents {
diff --git a/src/com/vaadin/ui/FormLayout.java b/src/com/vaadin/ui/FormLayout.java
index 756c79a4b1..63a973e30d 100644
--- a/src/com/vaadin/ui/FormLayout.java
+++ b/src/com/vaadin/ui/FormLayout.java
@@ -4,7 +4,6 @@
package com.vaadin.ui;
-import com.vaadin.terminal.gwt.client.ui.FormLayoutConnector;
/**
* FormLayout is used by {@link Form} to layout fields. It may also be used
@@ -21,7 +20,6 @@ import com.vaadin.terminal.gwt.client.ui.FormLayoutConnector;
* bottom are by default on.
*
*/
-@ClientWidget(FormLayoutConnector.class)
public class FormLayout extends AbstractOrderedLayout {
public FormLayout() {
diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java
index 0c8089258f..23497f758f 100644
--- a/src/com/vaadin/ui/GridLayout.java
+++ b/src/com/vaadin/ui/GridLayout.java
@@ -50,7 +50,6 @@ import com.vaadin.terminal.gwt.client.ui.LayoutClickEventHandler;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(GridLayoutConnector.class)
public class GridLayout extends AbstractLayout implements
Layout.AlignmentHandler, Layout.SpacingHandler, LayoutClickNotifier {
diff --git a/src/com/vaadin/ui/HorizontalLayout.java b/src/com/vaadin/ui/HorizontalLayout.java
index c053d711e2..807704e7cf 100644
--- a/src/com/vaadin/ui/HorizontalLayout.java
+++ b/src/com/vaadin/ui/HorizontalLayout.java
@@ -3,8 +3,6 @@
*/
package com.vaadin.ui;
-import com.vaadin.terminal.gwt.client.ui.HorizontalLayoutConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* Horizontal layout
@@ -18,7 +16,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* @since 5.3
*/
@SuppressWarnings("serial")
-@ClientWidget(value = HorizontalLayoutConnector.class, loadStyle = LoadStyle.EAGER)
public class HorizontalLayout extends AbstractOrderedLayout {
public HorizontalLayout() {
diff --git a/src/com/vaadin/ui/HorizontalSplitPanel.java b/src/com/vaadin/ui/HorizontalSplitPanel.java
index db3223aa88..7ea07cc61c 100644
--- a/src/com/vaadin/ui/HorizontalSplitPanel.java
+++ b/src/com/vaadin/ui/HorizontalSplitPanel.java
@@ -3,8 +3,6 @@
*/
package com.vaadin.ui;
-import com.vaadin.terminal.gwt.client.ui.HorizontalSplitPanelConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* A horizontal split panel contains two components and lays them horizontally.
@@ -29,7 +27,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* @VERSION@
* @since 6.5
*/
-@ClientWidget(value = HorizontalSplitPanelConnector.class, loadStyle = LoadStyle.EAGER)
public class HorizontalSplitPanel extends AbstractSplitPanel {
public HorizontalSplitPanel() {
super();
diff --git a/src/com/vaadin/ui/InlineDateField.java b/src/com/vaadin/ui/InlineDateField.java
index 3ae77dd856..cf61703318 100644
--- a/src/com/vaadin/ui/InlineDateField.java
+++ b/src/com/vaadin/ui/InlineDateField.java
@@ -7,7 +7,6 @@ package com.vaadin.ui;
import java.util.Date;
import com.vaadin.data.Property;
-import com.vaadin.terminal.gwt.client.ui.InlineDateFieldConnector;
/**
* <p>
@@ -22,7 +21,6 @@ import com.vaadin.terminal.gwt.client.ui.InlineDateFieldConnector;
* @VERSION@
* @since 5.0
*/
-@ClientWidget(InlineDateFieldConnector.class)
public class InlineDateField extends DateField {
public InlineDateField() {
diff --git a/src/com/vaadin/ui/Label.java b/src/com/vaadin/ui/Label.java
index 3092faa251..c69a68002b 100644
--- a/src/com/vaadin/ui/Label.java
+++ b/src/com/vaadin/ui/Label.java
@@ -10,8 +10,6 @@ import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.label.LabelConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* Label component for showing non-editable short texts.
@@ -38,7 +36,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(value = LabelConnector.class, loadStyle = LoadStyle.EAGER)
// TODO generics for interface Property
public class Label extends AbstractComponent implements Property,
Property.Viewer, Property.ValueChangeListener,
diff --git a/src/com/vaadin/ui/Link.java b/src/com/vaadin/ui/Link.java
index 3be5265bf3..4f57acc6e5 100644
--- a/src/com/vaadin/ui/Link.java
+++ b/src/com/vaadin/ui/Link.java
@@ -7,7 +7,6 @@ package com.vaadin.ui;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.gwt.client.ui.LinkConnector;
/**
* Link is used to create external or internal URL links.
@@ -18,7 +17,6 @@ import com.vaadin.terminal.gwt.client.ui.LinkConnector;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(LinkConnector.class)
public class Link extends AbstractComponent {
/* Target window border type constant: No window border */
diff --git a/src/com/vaadin/ui/ListSelect.java b/src/com/vaadin/ui/ListSelect.java
index cf76babaca..35ccb34b3c 100644
--- a/src/com/vaadin/ui/ListSelect.java
+++ b/src/com/vaadin/ui/ListSelect.java
@@ -9,14 +9,12 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.ListSelectConnector;
/**
* This is a simple list select without, for instance, support for new items,
* lazyloading, and other advanced features.
*/
@SuppressWarnings("serial")
-@ClientWidget(ListSelectConnector.class)
public class ListSelect extends AbstractSelect {
private int columns = 0;
diff --git a/src/com/vaadin/ui/MenuBar.java b/src/com/vaadin/ui/MenuBar.java
index 7d0d307daa..a58a742e8c 100644
--- a/src/com/vaadin/ui/MenuBar.java
+++ b/src/com/vaadin/ui/MenuBar.java
@@ -13,9 +13,7 @@ import java.util.Stack;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.gwt.client.ui.MenuBarConnector;
import com.vaadin.terminal.gwt.client.ui.VMenuBar;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* <p>
@@ -25,7 +23,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* </p>
*/
@SuppressWarnings("serial")
-@ClientWidget(value = MenuBarConnector.class, loadStyle = LoadStyle.LAZY)
public class MenuBar extends AbstractComponent {
// Items of the top-level menu
diff --git a/src/com/vaadin/ui/NativeButton.java b/src/com/vaadin/ui/NativeButton.java
index ede63f6d78..f14b448674 100644
--- a/src/com/vaadin/ui/NativeButton.java
+++ b/src/com/vaadin/ui/NativeButton.java
@@ -3,10 +3,8 @@
*/
package com.vaadin.ui;
-import com.vaadin.terminal.gwt.client.ui.NativeButtonConnector;
@SuppressWarnings("serial")
-@ClientWidget(NativeButtonConnector.class)
public class NativeButton extends Button {
public NativeButton() {
diff --git a/src/com/vaadin/ui/NativeSelect.java b/src/com/vaadin/ui/NativeSelect.java
index e7db9aa3ec..1f85f57c97 100644
--- a/src/com/vaadin/ui/NativeSelect.java
+++ b/src/com/vaadin/ui/NativeSelect.java
@@ -9,7 +9,6 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.NativeSelectConnector;
/**
* This is a simple drop-down select without, for instance, support for
@@ -18,7 +17,6 @@ import com.vaadin.terminal.gwt.client.ui.NativeSelectConnector;
* better choice.
*/
@SuppressWarnings("serial")
-@ClientWidget(NativeSelectConnector.class)
public class NativeSelect extends AbstractSelect {
// width in characters, mimics TextField
diff --git a/src/com/vaadin/ui/OptionGroup.java b/src/com/vaadin/ui/OptionGroup.java
index 789c16202d..5d671cbb13 100644
--- a/src/com/vaadin/ui/OptionGroup.java
+++ b/src/com/vaadin/ui/OptionGroup.java
@@ -17,14 +17,12 @@ import com.vaadin.event.FieldEvents.FocusEvent;
import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.OptionGroupConnector;
import com.vaadin.terminal.gwt.client.ui.VOptionGroup;
/**
* Configures select to be used as an option group.
*/
@SuppressWarnings("serial")
-@ClientWidget(OptionGroupConnector.class)
public class OptionGroup extends AbstractSelect implements
FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
diff --git a/src/com/vaadin/ui/Panel.java b/src/com/vaadin/ui/Panel.java
index a4ec70f551..763cfb8457 100644
--- a/src/com/vaadin/ui/Panel.java
+++ b/src/com/vaadin/ui/Panel.java
@@ -31,7 +31,6 @@ import com.vaadin.ui.Component.Focusable;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(PanelConnector.class)
public class Panel extends AbstractComponentContainer implements Scrollable,
ComponentContainer.ComponentAttachListener,
ComponentContainer.ComponentDetachListener, Action.Notifier, Focusable {
diff --git a/src/com/vaadin/ui/PasswordField.java b/src/com/vaadin/ui/PasswordField.java
index 725376d617..c1fccebbfe 100644
--- a/src/com/vaadin/ui/PasswordField.java
+++ b/src/com/vaadin/ui/PasswordField.java
@@ -4,13 +4,11 @@
package com.vaadin.ui;
import com.vaadin.data.Property;
-import com.vaadin.terminal.gwt.client.ui.PasswordFieldConnector;
/**
* A field that is used to enter secret text information like passwords. The
* entered text is not displayed on the screen.
*/
-@ClientWidget(PasswordFieldConnector.class)
public class PasswordField extends AbstractTextField {
/**
diff --git a/src/com/vaadin/ui/PopupView.java b/src/com/vaadin/ui/PopupView.java
index ef17b9135f..6babb5854f 100644
--- a/src/com/vaadin/ui/PopupView.java
+++ b/src/com/vaadin/ui/PopupView.java
@@ -10,7 +10,6 @@ import java.util.Map;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.PopupViewConnector;
/**
*
@@ -22,7 +21,6 @@ import com.vaadin.terminal.gwt.client.ui.PopupViewConnector;
* @author Vaadin Ltd.
*/
@SuppressWarnings("serial")
-@ClientWidget(PopupViewConnector.class)
public class PopupView extends AbstractComponentContainer {
private Content content;
diff --git a/src/com/vaadin/ui/ProgressIndicator.java b/src/com/vaadin/ui/ProgressIndicator.java
index 334727e449..f080199c72 100644
--- a/src/com/vaadin/ui/ProgressIndicator.java
+++ b/src/com/vaadin/ui/ProgressIndicator.java
@@ -8,7 +8,6 @@ import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.ProgressIndicatorConnector;
/**
* <code>ProgressIndicator</code> is component that shows user state of a
@@ -25,7 +24,6 @@ import com.vaadin.terminal.gwt.client.ui.ProgressIndicatorConnector;
* @since 4
*/
@SuppressWarnings("serial")
-@ClientWidget(ProgressIndicatorConnector.class)
public class ProgressIndicator extends AbstractField<Number> implements
Property.Viewer, Property.ValueChangeListener {
diff --git a/src/com/vaadin/ui/RichTextArea.java b/src/com/vaadin/ui/RichTextArea.java
index 8646f84c99..5c052e78f4 100644
--- a/src/com/vaadin/ui/RichTextArea.java
+++ b/src/com/vaadin/ui/RichTextArea.java
@@ -10,8 +10,6 @@ import java.util.Map;
import com.vaadin.data.Property;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.richtextarea.RichTextAreaConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* A simple RichTextArea to edit HTML format text.
@@ -20,7 +18,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* {@link RichTextArea} may produce unexpected results as formatting is counted
* into length of field.
*/
-@ClientWidget(value = RichTextAreaConnector.class, loadStyle = LoadStyle.LAZY)
public class RichTextArea extends AbstractField<String> {
/**
diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java
index 144b640be5..8181950fad 100644
--- a/src/com/vaadin/ui/Root.java
+++ b/src/com/vaadin/ui/Root.java
@@ -73,8 +73,6 @@ import com.vaadin.ui.Window.CloseListener;
*
* @since 7.0
*/
-// @ClientWidget(View.class) - Can't have annotation because of eager
-// classloaders in application servers and hard coded logic in client side code
public abstract class Root extends AbstractComponentContainer implements
Action.Container, Action.Notifier {
diff --git a/src/com/vaadin/ui/Select.java b/src/com/vaadin/ui/Select.java
index 3bbfa29f2b..5398f11391 100644
--- a/src/com/vaadin/ui/Select.java
+++ b/src/com/vaadin/ui/Select.java
@@ -23,7 +23,6 @@ import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
-import com.vaadin.terminal.gwt.client.ui.ComboBoxConnector;
/**
* <p>
@@ -44,7 +43,6 @@ import com.vaadin.terminal.gwt.client.ui.ComboBoxConnector;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(ComboBoxConnector.class)
public class Select extends AbstractSelect implements AbstractSelect.Filtering,
FieldEvents.BlurNotifier, FieldEvents.FocusNotifier {
diff --git a/src/com/vaadin/ui/Slider.java b/src/com/vaadin/ui/Slider.java
index 59aa5cd214..4509f7af1e 100644
--- a/src/com/vaadin/ui/Slider.java
+++ b/src/com/vaadin/ui/Slider.java
@@ -8,7 +8,6 @@ import java.util.Map;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.SliderConnector;
/**
* A component for selecting a numerical value within a range.
@@ -46,7 +45,6 @@ import com.vaadin.terminal.gwt.client.ui.SliderConnector;
*
* @author Vaadin Ltd.
*/
-@ClientWidget(SliderConnector.class)
public class Slider extends AbstractField<Double> {
public static final int ORIENTATION_HORIZONTAL = 0;
diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java
index 7bafb7e75c..82a2930dd8 100644
--- a/src/com/vaadin/ui/TabSheet.java
+++ b/src/com/vaadin/ui/TabSheet.java
@@ -24,7 +24,6 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.client.ui.TabsheetBaseConnector;
-import com.vaadin.terminal.gwt.client.ui.TabsheetConnector;
import com.vaadin.terminal.gwt.client.ui.VTabsheet;
import com.vaadin.ui.Component.Focusable;
import com.vaadin.ui.themes.Reindeer;
@@ -59,7 +58,6 @@ import com.vaadin.ui.themes.Runo;
* @VERSION@
* @since 3.0
*/
-@ClientWidget(TabsheetConnector.class)
public class TabSheet extends AbstractComponentContainer implements Focusable,
FocusNotifier, BlurNotifier {
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java
index ff83a9ef2e..1c62679e86 100644
--- a/src/com/vaadin/ui/Table.java
+++ b/src/com/vaadin/ui/Table.java
@@ -47,7 +47,6 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
-import com.vaadin.terminal.gwt.client.ui.TableConnector;
import com.vaadin.terminal.gwt.client.ui.VScrollTable;
import com.vaadin.terminal.gwt.client.ui.dd.VLazyInitItemIdentifiers;
@@ -75,7 +74,6 @@ import com.vaadin.terminal.gwt.client.ui.dd.VLazyInitItemIdentifiers;
* @since 3.0
*/
@SuppressWarnings({ "deprecation" })
-@ClientWidget(TableConnector.class)
public class Table extends AbstractSelect implements Action.Container,
Container.Ordered, Container.Sortable, ItemClickSource,
ItemClickNotifier, DragSource, DropTarget, HasComponents {
diff --git a/src/com/vaadin/ui/TextArea.java b/src/com/vaadin/ui/TextArea.java
index dafeb8afa7..adb980818e 100644
--- a/src/com/vaadin/ui/TextArea.java
+++ b/src/com/vaadin/ui/TextArea.java
@@ -7,12 +7,10 @@ package com.vaadin.ui;
import com.vaadin.data.Property;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.TextAreaConnector;
/**
* A text field that supports multi line editing.
*/
-@ClientWidget(TextAreaConnector.class)
public class TextArea extends AbstractTextField {
private static final int DEFAULT_ROWS = 5;
diff --git a/src/com/vaadin/ui/TextField.java b/src/com/vaadin/ui/TextField.java
index 9b6fd6ada1..567e9c1c10 100644
--- a/src/com/vaadin/ui/TextField.java
+++ b/src/com/vaadin/ui/TextField.java
@@ -5,8 +5,6 @@
package com.vaadin.ui;
import com.vaadin.data.Property;
-import com.vaadin.terminal.gwt.client.ui.TextFieldConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* <p>
@@ -29,7 +27,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(value = TextFieldConnector.class, loadStyle = LoadStyle.EAGER)
public class TextField extends AbstractTextField {
/**
diff --git a/src/com/vaadin/ui/Tree.java b/src/com/vaadin/ui/Tree.java
index 499fe9d63f..49cf3ea78a 100644
--- a/src/com/vaadin/ui/Tree.java
+++ b/src/com/vaadin/ui/Tree.java
@@ -61,7 +61,6 @@ import com.vaadin.tools.ReflectTools;
* @since 3.0
*/
@SuppressWarnings({ "serial", "deprecation" })
-@ClientWidget(TreeConnector.class)
public class Tree extends AbstractSelect implements Container.Hierarchical,
Action.Container, ItemClickSource, ItemClickNotifier, DragSource,
DropTarget {
diff --git a/src/com/vaadin/ui/TreeTable.java b/src/com/vaadin/ui/TreeTable.java
index 3dce3d8645..3fe080787a 100644
--- a/src/com/vaadin/ui/TreeTable.java
+++ b/src/com/vaadin/ui/TreeTable.java
@@ -13,7 +13,6 @@ import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
-import com.google.gwt.user.client.ui.Tree;
import com.vaadin.data.Container;
import com.vaadin.data.Container.Hierarchical;
import com.vaadin.data.Container.ItemSetChangeEvent;
@@ -48,7 +47,6 @@ import com.vaadin.ui.treetable.HierarchicalContainerOrderedWrapper;
* share UI state in the container.
*/
@SuppressWarnings({ "serial" })
-@ClientWidget(TreeTableConnector.class)
public class TreeTable extends Table implements Hierarchical {
private static final Logger logger = Logger.getLogger(TreeTable.class
diff --git a/src/com/vaadin/ui/TwinColSelect.java b/src/com/vaadin/ui/TwinColSelect.java
index 2e2fbb53fc..f64f05d9a8 100644
--- a/src/com/vaadin/ui/TwinColSelect.java
+++ b/src/com/vaadin/ui/TwinColSelect.java
@@ -9,7 +9,6 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.gwt.client.ui.TwinColSelectConnector;
import com.vaadin.terminal.gwt.client.ui.VTwinColSelect;
/**
@@ -17,7 +16,6 @@ import com.vaadin.terminal.gwt.client.ui.VTwinColSelect;
* side for selected items.
*/
@SuppressWarnings("serial")
-@ClientWidget(TwinColSelectConnector.class)
public class TwinColSelect extends AbstractSelect {
private int columns = 0;
diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java
index 3498eaa794..6aee91e935 100644
--- a/src/com/vaadin/ui/Upload.java
+++ b/src/com/vaadin/ui/Upload.java
@@ -15,10 +15,8 @@ import java.util.Map;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.StreamVariable.StreamingProgressEvent;
-import com.vaadin.terminal.gwt.client.ui.UploadConnector;
import com.vaadin.terminal.gwt.server.NoInputStreamException;
import com.vaadin.terminal.gwt.server.NoOutputStreamException;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* Component for uploading files from client to server.
@@ -61,7 +59,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(value = UploadConnector.class, loadStyle = LoadStyle.LAZY)
public class Upload extends AbstractComponent implements Component.Focusable {
/**
diff --git a/src/com/vaadin/ui/VerticalLayout.java b/src/com/vaadin/ui/VerticalLayout.java
index b067490406..a04d052d98 100644
--- a/src/com/vaadin/ui/VerticalLayout.java
+++ b/src/com/vaadin/ui/VerticalLayout.java
@@ -3,9 +3,6 @@
*/
package com.vaadin.ui;
-import com.vaadin.terminal.gwt.client.ui.VerticalLayoutConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
-
/**
* Vertical layout
*
@@ -19,7 +16,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* @since 5.3
*/
@SuppressWarnings("serial")
-@ClientWidget(value = VerticalLayoutConnector.class, loadStyle = LoadStyle.EAGER)
public class VerticalLayout extends AbstractOrderedLayout {
public VerticalLayout() {
diff --git a/src/com/vaadin/ui/VerticalSplitPanel.java b/src/com/vaadin/ui/VerticalSplitPanel.java
index 6cfde788b0..7c4a523ba4 100644
--- a/src/com/vaadin/ui/VerticalSplitPanel.java
+++ b/src/com/vaadin/ui/VerticalSplitPanel.java
@@ -3,8 +3,6 @@
*/
package com.vaadin.ui;
-import com.vaadin.terminal.gwt.client.ui.VerticalSplitPanelConnector;
-import com.vaadin.ui.ClientWidget.LoadStyle;
/**
* A vertical split panel contains two components and lays them vertically. The
@@ -23,7 +21,6 @@ import com.vaadin.ui.ClientWidget.LoadStyle;
* </pre>
*
*/
-@ClientWidget(value = VerticalSplitPanelConnector.class, loadStyle = LoadStyle.EAGER)
public class VerticalSplitPanel extends AbstractSplitPanel {
public VerticalSplitPanel() {
diff --git a/src/com/vaadin/ui/Video.java b/src/com/vaadin/ui/Video.java
index 2fc7cbc870..e3eae78988 100644
--- a/src/com/vaadin/ui/Video.java
+++ b/src/com/vaadin/ui/Video.java
@@ -30,7 +30,6 @@ import com.vaadin.terminal.gwt.client.ui.VideoConnector;
* @author Vaadin Ltd
* @since 6.7.0
*/
-@ClientWidget(VideoConnector.class)
public class Video extends AbstractMedia {
private Resource poster;
diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java
index ceda9a544b..1ac9839f4c 100644
--- a/src/com/vaadin/ui/Window.java
+++ b/src/com/vaadin/ui/Window.java
@@ -74,7 +74,6 @@ import com.vaadin.terminal.gwt.client.ui.WindowConnector.WindowState;
* @since 3.0
*/
@SuppressWarnings("serial")
-@ClientWidget(WindowConnector.class)
public class Window extends Panel implements FocusNotifier, BlurNotifier {
/**