From: Matti Tahvonen Date: Fri, 25 Sep 2009 12:07:09 +0000 (+0000) Subject: steps toward simpler widgetset creation. Still needs a lot of cleaning and refining. X-Git-Tag: 6.7.0.beta1~2433^2~8 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5ef5da15a7903262494d7e3fd7867dde7ed746c4;p=vaadin-framework.git steps toward simpler widgetset creation. Still needs a lot of cleaning and refining. svn changeset:8930/svn branch:2009-09-widget-packaging_3332 --- diff --git a/build/build.xml b/build/build.xml index e69ebed14d..ee73d898db 100644 --- a/build/build.xml +++ b/build/build.xml @@ -793,6 +793,7 @@ + @@ -815,6 +816,7 @@ + @@ -845,6 +847,7 @@ + @@ -868,6 +871,7 @@ + @@ -890,6 +894,7 @@ + @@ -912,6 +917,7 @@ + diff --git a/src/com/vaadin/demo/colorpicker/ColorPicker.java b/src/com/vaadin/demo/colorpicker/ColorPicker.java index a811d7ac92..55de19b73c 100644 --- a/src/com/vaadin/demo/colorpicker/ColorPicker.java +++ b/src/com/vaadin/demo/colorpicker/ColorPicker.java @@ -6,11 +6,14 @@ package com.vaadin.demo.colorpicker; import java.util.Map; +import com.vaadin.demo.colorpicker.gwt.client.ui.VColorPicker; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; import com.vaadin.ui.AbstractField; +import com.vaadin.ui.ClientWidget; @SuppressWarnings("serial") +@ClientWidget(VColorPicker.class) public class ColorPicker extends AbstractField { public ColorPicker() { diff --git a/src/com/vaadin/demo/colorpicker/gwt/ColorPickerWidgetSet.gwt.xml b/src/com/vaadin/demo/colorpicker/gwt/ColorPickerWidgetSet.gwt.xml index 718ab9e2c6..27ddc1d60f 100644 --- a/src/com/vaadin/demo/colorpicker/gwt/ColorPickerWidgetSet.gwt.xml +++ b/src/com/vaadin/demo/colorpicker/gwt/ColorPickerWidgetSet.gwt.xml @@ -1,11 +1,8 @@ - + - - - diff --git a/src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java b/src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java deleted file mode 100644 index 2c924c0239..0000000000 --- a/src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java +++ /dev/null @@ -1,36 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.colorpicker.gwt.client; - -import com.vaadin.demo.colorpicker.gwt.client.ui.VColorPicker; -import com.vaadin.terminal.gwt.client.DefaultWidgetSet; -import com.vaadin.terminal.gwt.client.Paintable; -import com.vaadin.terminal.gwt.client.UIDL; - -public class ColorPickerWidgetSet extends DefaultWidgetSet { - /** Resolves UIDL tag name to widget class. */ - @Override - protected Class resolveWidgetType(UIDL uidl) { - final String tag = uidl.getTag(); - if ("colorpicker".equals(tag)) { - return VColorPicker.class; - } - - // Let the DefaultWidgetSet handle resolution of default widgets - return super.resolveWidgetType(uidl); - } - - /** Creates a widget instance according to its class object. */ - @Override - public Paintable createWidget(UIDL uidl) { - final Class type = resolveWidgetType(uidl); - if (VColorPicker.class == type) { - return new VColorPicker(); - } - - // Let the DefaultWidgetSet handle creation of default widgets - return super.createWidget(uidl); - } -} diff --git a/src/com/vaadin/demo/coverflow/Coverflow.java b/src/com/vaadin/demo/coverflow/Coverflow.java index 149cf6e383..bd56261a38 100644 --- a/src/com/vaadin/demo/coverflow/Coverflow.java +++ b/src/com/vaadin/demo/coverflow/Coverflow.java @@ -4,11 +4,14 @@ package com.vaadin.demo.coverflow; +import com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; import com.vaadin.ui.AbstractSelect; +import com.vaadin.ui.ClientWidget; @SuppressWarnings( { "serial", "unchecked" }) +@ClientWidget(VCoverflow.class) public class Coverflow extends AbstractSelect { private String backgroundGradientStart = "FFFFFF"; diff --git a/src/com/vaadin/demo/coverflow/gwt/CoverflowWidgetSet.gwt.xml b/src/com/vaadin/demo/coverflow/gwt/CoverflowWidgetSet.gwt.xml index 36c016f131..a1987af121 100644 --- a/src/com/vaadin/demo/coverflow/gwt/CoverflowWidgetSet.gwt.xml +++ b/src/com/vaadin/demo/coverflow/gwt/CoverflowWidgetSet.gwt.xml @@ -1,8 +1,5 @@ - - - - + diff --git a/src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java b/src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java deleted file mode 100644 index bbde252540..0000000000 --- a/src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java +++ /dev/null @@ -1,36 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.demo.coverflow.gwt.client; - -import com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow; -import com.vaadin.terminal.gwt.client.DefaultWidgetSet; -import com.vaadin.terminal.gwt.client.Paintable; -import com.vaadin.terminal.gwt.client.UIDL; - -public class CoverflowWidgetSet extends DefaultWidgetSet { - /** Creates a widget according to its class name. */ - @Override - public Paintable createWidget(UIDL uidl) { - final Class classType = resolveWidgetType(uidl); - if (VCoverflow.class == classType) { - return new VCoverflow(); - } - - // Let the DefaultWidgetSet handle creation of default widgets - return super.createWidget(uidl); - } - - /** Resolves UIDL tag name to class . */ - @Override - protected Class resolveWidgetType(UIDL uidl) { - final String tag = uidl.getTag(); - if ("cover".equals(tag)) { - return VCoverflow.class; - } - - // Let the DefaultWidgetSet handle resolution of default widgets - return super.resolveWidgetType(uidl); - } -} \ No newline at end of file diff --git a/src/com/vaadin/demo/reservation/CalendarField.java b/src/com/vaadin/demo/reservation/CalendarField.java index 2af0f1ed71..349c6b59a8 100644 --- a/src/com/vaadin/demo/reservation/CalendarField.java +++ b/src/com/vaadin/demo/reservation/CalendarField.java @@ -12,14 +12,17 @@ import java.util.Iterator; import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property; +import com.vaadin.demo.reservation.gwt.client.ui.VCalendarField; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; +import com.vaadin.ui.ClientWidget; import com.vaadin.ui.DateField; // TODO send one month at a time, do lazyLoading // TODO check date limit when updating variables // TODO Allow item selection @SuppressWarnings("serial") +@ClientWidget(VCalendarField.class) public class CalendarField extends DateField implements Container.Viewer { private static final String TAGNAME = "calendarfield"; diff --git a/src/com/vaadin/demo/reservation/GoogleMap.java b/src/com/vaadin/demo/reservation/GoogleMap.java index e82f7c0f6a..19dee3aacf 100644 --- a/src/com/vaadin/demo/reservation/GoogleMap.java +++ b/src/com/vaadin/demo/reservation/GoogleMap.java @@ -12,12 +12,15 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.util.IndexedContainer; +import com.vaadin.demo.reservation.gwt.client.ui.VGoogleMap; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.PaintTarget; import com.vaadin.terminal.Sizeable; import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.ClientWidget; @SuppressWarnings("serial") +@ClientWidget(VGoogleMap.class) public class GoogleMap extends AbstractComponent implements Sizeable, Container.Viewer { private final String TAG_MARKERS = "markers"; diff --git a/src/com/vaadin/demo/reservation/gwt/ReservationWidgetSet.gwt.xml b/src/com/vaadin/demo/reservation/gwt/ReservationWidgetSet.gwt.xml index 1b2991d51c..4f38e07f26 100644 --- a/src/com/vaadin/demo/reservation/gwt/ReservationWidgetSet.gwt.xml +++ b/src/com/vaadin/demo/reservation/gwt/ReservationWidgetSet.gwt.xml @@ -23,7 +23,4 @@