]> source.dussan.org Git - vaadin-framework.git/commitdiff
#2643 more fixing of demo warnings
authorHenri Sara <henri.sara@itmill.com>
Mon, 25 May 2009 11:17:52 +0000 (11:17 +0000)
committerHenri Sara <henri.sara@itmill.com>
Mon, 25 May 2009 11:17:52 +0000 (11:17 +0000)
svn changeset:7987/svn branch:6.0

40 files changed:
src/com/vaadin/automatedtests/featurebrowser/FeatureBrowser.java
src/com/vaadin/demo/VaadinTunesLayout.java
src/com/vaadin/demo/colorpicker/ColorPicker.java
src/com/vaadin/demo/featurebrowser/FeatureBrowser.java
src/com/vaadin/demo/featurebrowser/GeneratedColumnExample.java
src/com/vaadin/demo/featurebrowser/TableExample.java
src/com/vaadin/demo/reservation/CalendarField.java
src/com/vaadin/demo/reservation/GoogleMap.java
src/com/vaadin/demo/reservation/ResourceSelectorPanel.java
src/com/vaadin/demo/reservation/SampleDB.java
src/com/vaadin/demo/reservation/gwt/client/ui/VCalendarField.java
src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java
src/com/vaadin/demo/reservation/simple/AdminView.java
src/com/vaadin/demo/reservation/simple/SampleDB.java
src/com/vaadin/demo/sampler/APIResource.java
src/com/vaadin/demo/sampler/ModeSwitch.java
src/com/vaadin/demo/sampler/SamplerApplication.java
src/com/vaadin/demo/sampler/features/accordions/AccordionDisabledExample.java
src/com/vaadin/demo/sampler/features/accordions/AccordionIconsExample.java
src/com/vaadin/demo/sampler/features/commons/ValidationExample.java
src/com/vaadin/demo/sampler/features/form/FormPojoExample.java
src/com/vaadin/demo/sampler/features/layouts/ApplicationLayoutExample.java
src/com/vaadin/demo/sampler/features/layouts/WebLayoutExample.java
src/com/vaadin/demo/sampler/features/panels/PanelBasicExample.java
src/com/vaadin/demo/sampler/features/panels/PanelLightExample.java
src/com/vaadin/demo/sampler/features/selects/ComboBoxContainsExample.java
src/com/vaadin/demo/sampler/features/selects/ComboBoxStartsWithExample.java
src/com/vaadin/demo/sampler/features/selects/ListSelectSingleExample.java
src/com/vaadin/demo/sampler/features/table/TableMainFeaturesExample.java
src/com/vaadin/demo/sampler/features/tabsheets/TabSheetDisabledExample.java
src/com/vaadin/demo/sampler/features/tabsheets/TabSheetIconsExample.java
src/com/vaadin/demo/sampler/features/tabsheets/TabSheetScrollingExample.java
src/com/vaadin/demo/sampler/features/trees/TreeMultiSelectExample.java
src/com/vaadin/demo/sampler/features/windows/NativeWindowExample.java
src/com/vaadin/demo/sampler/features/windows/SubwindowAutoSizedExample.java
src/com/vaadin/demo/sampler/features/windows/SubwindowCloseExample.java
src/com/vaadin/demo/sampler/features/windows/SubwindowExample.java
src/com/vaadin/demo/sampler/features/windows/SubwindowModalExample.java
src/com/vaadin/demo/sampler/features/windows/SubwindowPositionedExample.java
src/com/vaadin/demo/sampler/features/windows/SubwindowSizedExample.java

index 275d42efb6fcae8906b302ccac8db8974d00dda2..b6f2e0e16378feb61c14ac93cdbca76201442041 100644 (file)
@@ -54,7 +54,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
     private TabSheet ts;
 
     // Example "cache"
-    private final HashMap exampleInstances = new HashMap();
+    private final HashMap<Class<?>, Component> exampleInstances = new HashMap<Class<?>, Component>();
     private String section;
 
     // List of examples
@@ -129,9 +129,9 @@ public class FeatureBrowser extends com.vaadin.Application implements
         final SplitPanel split = new SplitPanel(
                 SplitPanel.ORIENTATION_HORIZONTAL);
         split.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
-        main.setLayout(split);
+        main.setContent(split);
 
-        final HashMap sectionIds = new HashMap();
+        final HashMap<String, Object> sectionIds = new HashMap<String, Object>();
         final HierarchicalContainer container = createContainer();
         final Object rootId = container.addItem();
         Item item = container.getItem(rootId);
@@ -212,7 +212,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
             public void buttonClick(ClickEvent event) {
                 Component component = (Component) ts.getComponentIterator()
                         .next();
-                String caption = ts.getTabCaption(component);
+                String caption = ts.getTab(component).getCaption();
                 try {
                     component = component.getClass().newInstance();
                 } catch (Exception e) {
@@ -222,7 +222,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
                 Window w = new Window(caption);
                 w.setWidth("640px");
                 if (Layout.class.isAssignableFrom(component.getClass())) {
-                    w.setLayout((Layout) component);
+                    w.setContent((Layout) component);
                 } else {
                     // w.getLayout().getSize().setSizeFull();
                     w.addComponent(component);
@@ -237,7 +237,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
             public void buttonClick(ClickEvent event) {
                 Component component = (Component) ts.getComponentIterator()
                         .next();
-                final String caption = ts.getTabCaption(component);
+                final String caption = ts.getTab(component).getCaption();
                 Window w = getWindow(caption);
                 if (w == null) {
                     try {
@@ -249,7 +249,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
                     w = new Window(caption);
                     w.setName(caption);
                     if (Layout.class.isAssignableFrom(component.getClass())) {
-                        w.setLayout((Layout) component);
+                        w.setContent((Layout) component);
                     } else {
                         // w.getLayout().getSize().setSizeFull();
                         w.addComponent(component);
@@ -381,7 +381,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
                 return null;
             }
         }
-        return (Component) exampleInstances.get(componentClass);
+        return exampleInstances.get(componentClass);
     }
 
 }
index 695c4dc2cfcb4e7015066a2aa8030f1405f728bc..6b82e53e0a522d2749d3d661a5bfca3272f493d7 100644 (file)
@@ -51,7 +51,7 @@ public class VaadinTunesLayout extends Application {
 
         // Our root window contains one VerticalLayout by default, let's make
         // sure it's 100% sized, and remove unwanted margins
-        root.getLayout().setSizeFull();
+        root.getContent().setSizeFull();
         root.getLayout().setMargin(false);
 
         // Top area, containing playback and volume controls, play status, view
@@ -172,7 +172,7 @@ public class VaadinTunesLayout extends Application {
 
         // The splitpanel is by default 100% x 100%, but we'll need to adjust
         // our main window layout to accomodate the height
-        ((VerticalLayout) root.getLayout()).setExpandRatio(bottom, 1.0F);
+        ((VerticalLayout) root.getContent()).setExpandRatio(bottom, 1.0F);
 
         // Give the sidebar less space than the listing
         bottom.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
index 520a99d04a0139bc05b1054077dc46b7f3a0e198..99a3abd37a55a9dc4690221057b18039425b5b87 100644 (file)
@@ -18,7 +18,7 @@ public class ColorPicker extends AbstractField {
         setValue(new String("white"));
     }
 
-    /** The property value of the field is an Integer. */
+    /** The property value of the field is a String. */
     @Override
     public Class getType() {
         return String.class;
index 45da691988ca575c57079755d0fc0a19fc6eb003..5b9e769015c9016300ae15682753abdc6157b1cd 100644 (file)
@@ -53,7 +53,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
     private TabSheet ts;
 
     // Example "cache"
-    private final HashMap exampleInstances = new HashMap();
+    private final HashMap<Class<?>, Component> exampleInstances = new HashMap<Class<?>, Component>();
     private String section;
 
     // List of examples
@@ -129,7 +129,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
         split.setSplitPosition(200, SplitPanel.UNITS_PIXELS);
         main.setContent(split);
 
-        final HashMap sectionIds = new HashMap();
+        final HashMap<String, Object> sectionIds = new HashMap<String, Object>();
         final HierarchicalContainer container = createContainer();
         final Object rootId = container.addItem();
         Item item = container.getItem(rootId);
@@ -166,7 +166,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
         tree.addListener(this);
         tree.setImmediate(true);
         tree.expandItemsRecursively(rootId);
-        for (Iterator i = container.getItemIds().iterator(); i.hasNext();) {
+        for (Iterator<?> i = container.getItemIds().iterator(); i.hasNext();) {
             Object id = i.next();
             if (container.getChildren(id) == null) {
                 tree.setChildrenAllowed(id, false);
@@ -209,7 +209,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
             public void buttonClick(ClickEvent event) {
                 Component component = (Component) ts.getComponentIterator()
                         .next();
-                String caption = ts.getTabCaption(component);
+                String caption = ts.getTab(component).getCaption();
                 try {
                     component = component.getClass().newInstance();
                 } catch (Exception e) {
@@ -233,7 +233,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
             public void buttonClick(ClickEvent event) {
                 Component component = (Component) ts.getComponentIterator()
                         .next();
-                final String caption = ts.getTabCaption(component);
+                final String caption = ts.getTab(component).getCaption();
                 Window w = getWindow(caption);
                 if (w == null) {
                     try {
@@ -347,8 +347,8 @@ public class FeatureBrowser extends com.vaadin.Application implements
                 tree.setValue(table.getValue());
                 table.addListener(this);
                 final Item item = table.getItem(table.getValue());
-                final Class c = (Class) item.getItemProperty(PROPERTY_ID_CLASS)
-                        .getValue();
+                final Class<?> c = (Class<?>) item.getItemProperty(
+                        PROPERTY_ID_CLASS).getValue();
                 final Component component = getComponent(c);
                 if (component != null) {
                     final String caption = (String) item.getItemProperty(
@@ -368,7 +368,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
 
     }
 
-    private Component getComponent(Class componentClass) {
+    private Component getComponent(Class<?> componentClass) {
         if (!exampleInstances.containsKey(componentClass)) {
             try {
                 final Component c = (Component) componentClass.newInstance();
@@ -377,7 +377,7 @@ public class FeatureBrowser extends com.vaadin.Application implements
                 return null;
             }
         }
-        return (Component) exampleInstances.get(componentClass);
+        return exampleInstances.get(componentClass);
     }
 
 }
index cbb543722c62a69cad363586cbff25295ff88946..0ce1afb5117774e3834fd64c46684d483bca3ee1 100644 (file)
@@ -4,10 +4,10 @@
 
 package com.vaadin.demo.featurebrowser;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.GregorianCalendar;
-import java.util.Vector;
 
 import com.vaadin.data.Container;
 import com.vaadin.data.Item;
@@ -15,10 +15,10 @@ import com.vaadin.data.Property;
 import com.vaadin.data.Container.Indexed;
 import com.vaadin.data.util.BeanItem;
 import com.vaadin.ui.AbstractField;
-import com.vaadin.ui.BaseFieldFactory;
 import com.vaadin.ui.CheckBox;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.DefaultFieldFactory;
 import com.vaadin.ui.Field;
 import com.vaadin.ui.Label;
 import com.vaadin.ui.Table;
@@ -117,15 +117,15 @@ public class GeneratedColumnExample extends CustomComponent {
      * implementations, as they are not needed in this example.
      */
     public class MySimpleIndexedContainer implements Container, Indexed {
-        Vector items;
+        ArrayList<BeanItem> items;
         Object itemtemplate;
 
         public MySimpleIndexedContainer(Object itemtemplate) {
             this.itemtemplate = itemtemplate;
-            items = new Vector(); // Yeah this is just a test
+            items = new ArrayList<BeanItem>(); // Yeah this is just a test
         }
 
-        public boolean addContainerProperty(Object propertyId, Class type,
+        public boolean addContainerProperty(Object propertyId, Class<?> type,
                 Object defaultValue) throws UnsupportedOperationException {
             throw new UnsupportedOperationException();
         }
@@ -165,7 +165,7 @@ public class GeneratedColumnExample extends CustomComponent {
             if (itemId instanceof Integer) {
                 int pos = ((Integer) itemId).intValue();
                 if (pos >= 0 && pos < items.size()) {
-                    Item item = (Item) items.get(pos);
+                    Item item = items.get(pos);
 
                     // The BeanItem provides the property objects for the items.
                     return item.getItemProperty(propertyId);
@@ -175,7 +175,7 @@ public class GeneratedColumnExample extends CustomComponent {
         }
 
         /** Table calls this to get the column names. */
-        public Collection getContainerPropertyIds() {
+        public Collection<?> getContainerPropertyIds() {
             Item item = new BeanItem(itemtemplate);
 
             // The BeanItem knows how to get the property names from the bean.
@@ -186,21 +186,21 @@ public class GeneratedColumnExample extends CustomComponent {
             if (itemId instanceof Integer) {
                 int pos = ((Integer) itemId).intValue();
                 if (pos >= 0 && pos < items.size()) {
-                    return (Item) items.get(pos);
+                    return items.get(pos);
                 }
             }
             return null;
         }
 
-        public Collection getItemIds() {
-            Vector ids = new Vector(items.size());
+        public Collection<?> getItemIds() {
+            ArrayList<Integer> ids = new ArrayList<Integer>(items.size());
             for (int i = 0; i < items.size(); i++) {
                 ids.add(Integer.valueOf(i));
             }
             return ids;
         }
 
-        public Class getType(Object propertyId) {
+        public Class<?> getType(Object propertyId) {
             return BeanItem.class;
         }
 
@@ -427,11 +427,13 @@ public class GeneratedColumnExample extends CustomComponent {
     /**
      * Custom field factory that sets the fields as immediate.
      */
-    public class ImmediateFieldFactory extends BaseFieldFactory {
+    public class ImmediateFieldFactory extends DefaultFieldFactory {
         @Override
-        public Field createField(Class type, Component uiContext) {
-            // Let the BaseFieldFactory create the fields
-            Field field = super.createField(type, uiContext);
+        public Field createField(Container container, Object itemId,
+                Object propertyId, Component uiContext) {
+            // Let the DefaultFieldFactory create the fields
+            Field field = super.createField(container, itemId, propertyId,
+                    uiContext);
 
             // ...and just set them as immediate
             ((AbstractField) field).setImmediate(true);
@@ -529,7 +531,7 @@ public class GeneratedColumnExample extends CustomComponent {
 
         // Use a custom field factory to set the edit fields as immediate.
         // This is used when the table is in editable mode.
-        table.setFieldFactory(new ImmediateFieldFactory());
+        table.setTableFieldFactory(new ImmediateFieldFactory());
 
         // Setting the table itself as immediate has no relevance in this
         // example,
index 057bf380b5fd97d589daaf80f543a984f682eab6..808762724b8772079991ddf46e852775f9f80b0b 100644 (file)
@@ -232,6 +232,7 @@ public class TableExample extends CustomComponent implements Action.Handler,
         }\r
     }\r
 \r
+    @SuppressWarnings("unchecked")\r
     public void buttonClick(ClickEvent event) {\r
         final Button b = event.getButton();\r
         if (b == deselect) {\r
index f555c832281028c62db0b836f87772bae18cc853..2af0f1ed71a80c29ecfcf594b7e33cfeb1f4e1b1 100644 (file)
@@ -126,19 +126,19 @@ public class CalendarField extends DateField implements Container.Viewer {
 \r
         // Check old propertyIds\r
         if (itemEndPropertyId != null) {\r
-            final Class c = dataSource.getType(itemEndPropertyId);\r
+            final Class<?> c = dataSource.getType(itemEndPropertyId);\r
             if (!Date.class.isAssignableFrom(c)) {\r
                 itemEndPropertyId = null;\r
             }\r
         }\r
         if (itemNotimePropertyId != null) {\r
-            final Class c = dataSource.getType(itemNotimePropertyId);\r
+            final Class<?> c = dataSource.getType(itemNotimePropertyId);\r
             if (!Boolean.class.isAssignableFrom(c)) {\r
                 itemNotimePropertyId = null;\r
             }\r
         }\r
         if (itemStartPropertyId != null) {\r
-            final Class c = dataSource.getType(itemStartPropertyId);\r
+            final Class<?> c = dataSource.getType(itemStartPropertyId);\r
             if (Date.class.isAssignableFrom(c)) {\r
                 // All we _really_ need is one date\r
                 return true;\r
@@ -147,10 +147,10 @@ public class CalendarField extends DateField implements Container.Viewer {
             }\r
         }\r
         // We need at least one Date\r
-        final Collection ids = dataSource.getContainerPropertyIds();\r
-        for (final Iterator it = ids.iterator(); it.hasNext();) {\r
+        final Collection<?> ids = dataSource.getContainerPropertyIds();\r
+        for (final Iterator<?> it = ids.iterator(); it.hasNext();) {\r
             final Object id = it.next();\r
-            final Class c = dataSource.getType(id);\r
+            final Class<?> c = dataSource.getType(id);\r
             if (Date.class.isAssignableFrom(c)) {\r
                 itemStartPropertyId = id;\r
                 return true;\r
@@ -257,7 +257,7 @@ public class CalendarField extends DateField implements Container.Viewer {
                 month = ((Date) value).getMonth();\r
             }\r
 \r
-            for (final Iterator it = dataSource.getItemIds().iterator(); it\r
+            for (final Iterator<?> it = dataSource.getItemIds().iterator(); it\r
                     .hasNext();) {\r
                 final Object itemId = it.next();\r
                 final Item item = dataSource.getItem(itemId);\r
index 54d7d4bcf7b3bd129a689acb0a857afcfc00c4ff..e82f7c0f6ac64217693a3ca21dd5f3867927897e 100644 (file)
@@ -55,8 +55,8 @@ public class GoogleMap extends AbstractComponent implements Sizeable,
 \r
         if (dataSource != null) {\r
             target.startTag(TAG_MARKERS);\r
-            final Collection itemIds = dataSource.getItemIds();\r
-            for (final Iterator it = itemIds.iterator(); it.hasNext();) {\r
+            final Collection<?> itemIds = dataSource.getItemIds();\r
+            for (final Iterator<?> it = itemIds.iterator(); it.hasNext();) {\r
                 final Object itemId = it.next();\r
                 final Item item = dataSource.getItem(itemId);\r
                 Property p = item.getItemProperty(getItemMarkerXPropertyId());\r
index c73e287ef1555783f6953a11eda6200cb1d85af0..a99cb239407bbd8bbe6caf335b428f1c66398ad6 100644 (file)
@@ -17,7 +17,7 @@ import com.vaadin.ui.Panel;
 import com.vaadin.ui.VerticalLayout;\r
 import com.vaadin.ui.Button.ClickEvent;\r
 \r
-@SuppressWarnings("serial")\r
+@SuppressWarnings( { "serial", "unchecked" })\r
 public class ResourceSelectorPanel extends Panel implements\r
         Button.ClickListener {\r
     private final HashMap categoryLayouts = new HashMap();\r
index a9ab81fc1bd6988dc85543fefb1321c2b7dd026e..9be151c9e02f1de77e8747684527beadaa7df597 100644 (file)
@@ -267,7 +267,7 @@ public class SampleDB {
 
     }
 
-    public Container getReservations(List resources) {
+    public Container getReservations(List<?> resources) {
         // TODO where reserved_by=?
         // TODO where from=?
         // TODO where to=?
@@ -277,7 +277,7 @@ public class SampleDB {
                 + Resource.PROPERTY_ID_ID;
         if (resources != null && resources.size() > 0) {
             final StringBuffer s = new StringBuffer();
-            for (final Iterator it = resources.iterator(); it.hasNext();) {
+            for (final Iterator<?> it = resources.iterator(); it.hasNext();) {
                 if (s.length() > 0) {
                     s.append(",");
                 }
@@ -397,14 +397,14 @@ public class SampleDB {
                 "Customer meeting", "Guests arriving at harbour",
                 "Moving furniture", "Taking guests to see town" };
         final Container cat = getCategories();
-        final Collection cIds = cat.getItemIds();
-        for (final Iterator it = cIds.iterator(); it.hasNext();) {
+        final Collection<?> cIds = cat.getItemIds();
+        for (final Iterator<?> it = cIds.iterator(); it.hasNext();) {
             final Object id = it.next();
             final Item ci = cat.getItem(id);
             final String c = (String) ci.getItemProperty(
                     Resource.PROPERTY_ID_CATEGORY).getValue();
             final Container resources = getResources(c);
-            final Collection rIds = resources.getItemIds();
+            final Collection<?> rIds = resources.getItemIds();
             final Calendar cal = Calendar.getInstance();
             cal.set(Calendar.MINUTE, 0);
             cal.set(Calendar.SECOND, 0);
@@ -413,7 +413,7 @@ public class SampleDB {
             // cal.add(Calendar.DAY_OF_MONTH, -days);
             for (int i = 0; i < days; i++) {
                 int r = 3;
-                for (final Iterator rit = rIds.iterator(); rit.hasNext()
+                for (final Iterator<?> rit = rIds.iterator(); rit.hasNext()
                         && r > 0; r--) {
                     final Object rid = rit.next();
                     final Item resource = resources.getItem(rid);
index ad9b2f8ae3a3ddb8e9aed92c27c804b22de4c5c6..0ccb5b73ef41cac590a2546af55d5966e12903b1 100644 (file)
@@ -24,6 +24,7 @@ import com.vaadin.terminal.gwt.client.ui.CalendarEntry;
 import com.vaadin.terminal.gwt.client.ui.VCalendarPanel;\r
 import com.vaadin.terminal.gwt.client.ui.VDateField;\r
 \r
+@SuppressWarnings( { "deprecation", "unchecked" })\r
 public class VCalendarField extends VDateField {\r
 \r
     private final VCalendarPanel calPanel;\r
@@ -87,7 +88,6 @@ public class VCalendarField extends VDateField {
         buildDayView(date);\r
     }\r
 \r
-    @SuppressWarnings("deprecation")\r
     protected void buildDayView(Date date) {\r
         if (hourPanel == null) {\r
             hourPanel = new SimplePanel();\r
@@ -219,7 +219,6 @@ public class VCalendarField extends VDateField {
 \r
         private final HashMap dates = new HashMap();\r
 \r
-        @SuppressWarnings("deprecation")\r
         public void addItem(UIDL item) {\r
             final String styleName = item.getStringAttribute("styleName");\r
             // final Integer id = new Integer(item.getIntAttribute("id"));\r
@@ -265,7 +264,6 @@ public class VCalendarField extends VDateField {
             }\r
         }\r
 \r
-        @SuppressWarnings("deprecation")\r
         public List getEntries(Date date, int resolution) {\r
             final ArrayList res = new ArrayList();\r
             if (date == null) {\r
index 026f89f1beba8056a4a06d75d61110adb70a6cc5..e6150c39b7ebfce62ee1836f516d2d0ee3ff732d 100644 (file)
@@ -78,6 +78,7 @@ public class VGoogleMap extends Composite implements Paintable {
     private void addMarkerPopup(Marker marker, final String html) {\r
         marker.addMarkerClickHandler(new MarkerClickHandler() {\r
 \r
+            @SuppressWarnings("deprecation")\r
             public void onClick(MarkerClickEvent event) {\r
                 widget.getInfoWindow().open(event.getSender().getPoint(),\r
                         new InfoWindowContent(html));\r
index 59d772b80a23a8b920c92f34bbf5e80e01d3f5b2..49798f51817c62567366f265e653c30b34825599 100644 (file)
@@ -76,8 +76,7 @@ public class AdminView extends VerticalLayout {
             public void buttonClick(ClickEvent event) {
                 if (editedItem == null) {
                     // save
-                    int addResource = application.getDb().addResource(
-                            name.getValue().toString(),
+                    application.getDb().addResource(name.getValue().toString(),
                             desc.getValue().toString());
                 } else {
                     // update
index 286f1dd564e40efd596a54aa74ae4d3e509050ac..bd1808e38501824006f1b75c45aa8ef1d7e99d3b 100644 (file)
@@ -236,7 +236,7 @@ public class SampleDB {
 
     }
 
-    public Container getReservations(List resources) {
+    public Container getReservations(List<?> resources) {
         // TODO where reserved_by=?
         // TODO where from=?
         // TODO where to=?
@@ -246,7 +246,7 @@ public class SampleDB {
                 + Resource.PROPERTY_ID_ID;
         if (resources != null && resources.size() > 0) {
             final StringBuffer s = new StringBuffer();
-            for (final Iterator it = resources.iterator(); it.hasNext();) {
+            for (final Iterator<?> it = resources.iterator(); it.hasNext();) {
                 if (s.length() > 0) {
                     s.append(",");
                 }
@@ -355,14 +355,14 @@ public class SampleDB {
                 "Customer meeting", "Guests arriving at harbour",
                 "Moving furniture", "Taking guests to see town" };
         final Container cat = getCategories();
-        final Collection cIds = cat.getItemIds();
-        for (final Iterator it = cIds.iterator(); it.hasNext();) {
+        final Collection<?> cIds = cat.getItemIds();
+        for (final Iterator<?> it = cIds.iterator(); it.hasNext();) {
             final Object id = it.next();
             final Item ci = cat.getItem(id);
             final String c = (String) ci.getItemProperty(
                     Resource.PROPERTY_ID_CATEGORY).getValue();
             final Container resources = getResources(c);
-            final Collection rIds = resources.getItemIds();
+            final Collection<?> rIds = resources.getItemIds();
             final Calendar cal = Calendar.getInstance();
             cal.set(Calendar.MINUTE, 0);
             cal.set(Calendar.SECOND, 0);
@@ -371,7 +371,7 @@ public class SampleDB {
             // cal.add(Calendar.DAY_OF_MONTH, -days);
             for (int i = 0; i < days; i++) {
                 int r = 3;
-                for (final Iterator rit = rIds.iterator(); rit.hasNext()
+                for (final Iterator<?> rit = rIds.iterator(); rit.hasNext()
                         && r > 0; r--) {
                     final Object rid = rit.next();
                     final Item resource = resources.getItem(rid);
index 111b0be60ffe5cbe3170f3fb76c2e269fcd1fa25..76719f48ab9e954a89fa1e6d3ca9057247792ebd 100644 (file)
@@ -14,15 +14,15 @@ public class APIResource extends NamedExternalResource {
     private static final String SERVLET_BASE = "http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2";
     private static final String PORTLET_BASE = "http://developers.sun.com/docs/jscreator/apis/portlet";
 
-    public APIResource(Class clazz) {
+    public APIResource(Class<?> clazz) {
         this(resolveBaseUrl(clazz), clazz);
     }
 
-    public APIResource(String baseUrl, Class clazz) {
+    public APIResource(String baseUrl, Class<?> clazz) {
         super(resolveName(clazz), getJavadocUrl(baseUrl, clazz));
     }
 
-    private static String getJavadocUrl(String baseUrl, Class clazz) {
+    private static String getJavadocUrl(String baseUrl, Class<?> clazz) {
         if (!baseUrl.endsWith("/")) {
             baseUrl += "/";
         }
@@ -38,7 +38,7 @@ public class APIResource extends NamedExternalResource {
      * @param clazz
      * @return
      */
-    private static String resolveBaseUrl(Class clazz) {
+    private static String resolveBaseUrl(Class<?> clazz) {
         String name = clazz.getName();
         if (name.startsWith("javax.servlet.")) {
             return SERVLET_BASE;
@@ -50,8 +50,8 @@ public class APIResource extends NamedExternalResource {
         return VAADIN_BASE;
     }
 
-    private static String resolveName(Class clazz) {
-        Class ec = clazz.getEnclosingClass();
+    private static String resolveName(Class<?> clazz) {
+        Class<?> ec = clazz.getEnclosingClass();
         return (ec != null ? ec.getSimpleName() + "." : "")
                 + clazz.getSimpleName();
     }
index c6565c0c618d19171120e24acc17684a43907e8d..738f9f07cba653b5fb8ee78da9254fb54a19496a 100644 (file)
@@ -72,10 +72,11 @@ public class ModeSwitch extends CustomComponent {
         updateStyles();
     }
 
+    @SuppressWarnings("unchecked")
     private void updateStyles() {
         boolean first = true;
-        for (Iterator it = layout.getComponentIterator(); it.hasNext();) {
-            Button b = (Button) it.next();
+        for (Iterator<Button> it = layout.getComponentIterator(); it.hasNext();) {
+            Button b = it.next();
             String isOn = (b.getData() == mode ? "-on" : "");
             if (first) {
                 first = false;
index ea35d986ac01ef00029d9483b8edd81683df021a..2b5fc4a8ac9adf6e8470a2bfb7896c6698d70e63 100644 (file)
@@ -126,9 +126,11 @@ public class SamplerApplication extends Application {
      * @param clazz
      * @return
      */
+    @SuppressWarnings("unchecked")
     public static Feature getFeatureFor(Class clazz) {
-        for (Iterator it = allFeatures.getItemIds().iterator(); it.hasNext();) {
-            Feature f = (Feature) it.next();
+        for (Iterator<Feature> it = allFeatures.getItemIds().iterator(); it
+                .hasNext();) {
+            Feature f = it.next();
             if (f.getClass() == clazz) {
                 return f;
             }
@@ -174,7 +176,7 @@ public class SamplerApplication extends Application {
         SamplerWindow() {
             // Main top/expanded-bottom layout
             VerticalLayout mainExpand = new VerticalLayout();
-            setLayout(mainExpand);
+            setContent(mainExpand);
             setSizeFull();
             mainExpand.setSizeFull();
             setCaption("Vaadin Sampler");
@@ -316,7 +318,7 @@ public class SamplerApplication extends Application {
             search.setNullSelectionAllowed(true);
             search.setImmediate(true);
             search.setContainerDataSource(allFeatures);
-            for (Iterator it = allFeatures.getItemIds().iterator(); it
+            for (Iterator<?> it = allFeatures.getItemIds().iterator(); it
                     .hasNext();) {
                 Object id = it.next();
                 if (id instanceof FeatureSet) {
@@ -678,17 +680,18 @@ public class SamplerApplication extends Application {
 
         FeatureGrid() {
             setSizeFull();
-            setLayout(grid);
+            setContent(grid);
             grid.setSizeUndefined();
             grid.setSpacing(true);
             setStyleName(Panel.STYLE_LIGHT);
         }
 
+        @SuppressWarnings("unchecked")
         public void setFeatureContainer(HierarchicalContainer c) {
             grid.removeAllComponents();
-            Collection features = c.getItemIds();
-            for (Iterator it = features.iterator(); it.hasNext();) {
-                final Feature f = (Feature) it.next();
+            Collection<Feature> features = c.getItemIds();
+            for (Iterator<Feature> it = features.iterator(); it.hasNext();) {
+                final Feature f = it.next();
                 if (f instanceof FeatureSet) {
                     grid.newLine();
                     Label title = new Label(f.getName());
index 5be3d68d24e1ca7355fb0294e5b47eb5b1148bdb..edc1b6a95a6400f77438496c583d4e42ccfcb059 100644 (file)
@@ -20,6 +20,7 @@ public class AccordionDisabledExample extends VerticalLayout implements
     private Label l1;\r
     private Label l2;\r
     private Label l3;\r
+    @SuppressWarnings("unused")\r
     private Tab t1;\r
     private Tab t2;\r
     private Tab t3;\r
index 886fdcd86148080d34a7ec44f1292801f324e9b6..9bb8418fbc4bc0ee6cc33184364a2cb5fadc6021 100644 (file)
@@ -4,7 +4,9 @@ import com.vaadin.terminal.ThemeResource;
 import com.vaadin.ui.Accordion;\r
 import com.vaadin.ui.HorizontalLayout;\r
 import com.vaadin.ui.Label;\r
+import com.vaadin.ui.TabSheet;\r
 import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;\r
+import com.vaadin.ui.TabSheet.Tab;\r
 \r
 @SuppressWarnings("serial")\r
 public class AccordionIconsExample extends HorizontalLayout implements\r
@@ -38,7 +40,10 @@ public class AccordionIconsExample extends HorizontalLayout implements
     }\r
 \r
     public void selectedTabChange(SelectedTabChangeEvent event) {\r
-        String c = a.getTabCaption(event.getTabSheet().getSelectedTab());\r
-        getWindow().showNotification("Selected tab: " + c);\r
+        TabSheet tabsheet = event.getTabSheet();\r
+        Tab tab = tabsheet.getTab(tabsheet.getSelectedTab());\r
+        if (tab != null) {\r
+            getWindow().showNotification("Selected tab: " + tab.getCaption());\r
+        }\r
     }\r
 }\r
index 44339f926a92d313bf6ccd3693e4472169e47738..1c88312d761e90078e711f9dd29283c2b27dc899 100644 (file)
@@ -14,7 +14,7 @@ import com.vaadin.ui.VerticalLayout;
 @SuppressWarnings("serial")
 public class ValidationExample extends VerticalLayout {
 
-    HashSet usernames = new HashSet();
+    HashSet<String> usernames = new HashSet<String>();
 
     public ValidationExample() {
         setSpacing(true);
@@ -53,9 +53,11 @@ public class ValidationExample extends VerticalLayout {
             public void valueChange(ValueChangeEvent event) {
                 TextField tf = (TextField) event.getProperty();
                 tf.validate();
-                usernames.add(tf.getValue());
-                addComponent(new Label("Added " + tf.getValue()
-                        + " to usernames"));
+                if (tf.getValue() != null) {
+                    usernames.add(tf.getValue().toString());
+                    addComponent(new Label("Added " + tf.getValue()
+                            + " to usernames"));
+                }
             }
         });
 
index 1b29af31f4b817f9f0274766f2da9e913880a6bc..3ee7d60b1256bbee97142f6deaebe02608a66e34 100644 (file)
@@ -103,8 +103,7 @@ public class FormPojoExample extends VerticalLayout {
 
         public PersonFieldFactory() {
             countries.setWidth("30em");
-            countries.setContainerDataSource(ExampleUtil
-                    .getStaticISO3166Container());
+            countries.setContainerDataSource(ExampleUtil.getISO3166Container());
             countries
                     .setItemCaptionPropertyId(ExampleUtil.iso3166_PROPERTY_NAME);
             countries.setItemIconPropertyId(ExampleUtil.iso3166_PROPERTY_FLAG);
index c809d66ca21abb675b85b226f5a7ea536458d061..64be08f74b5c870567ff4f31a2f60122c51d26c0 100644 (file)
@@ -65,7 +65,7 @@ public class ApplicationLayoutExample extends VerticalLayout {
             Tree tree = new Tree();\r
             tree.setContainerDataSource(ExampleUtil.getHardwareContainer());\r
             tree.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME);\r
-            for (Iterator it = tree.rootItemIds().iterator(); it.hasNext();) {\r
+            for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) {\r
                 tree.expandItemsRecursively(it.next());\r
             }\r
             treePanel.addComponent(tree);\r
index 08bfb4eb97c21a382aa3d2b9db2497f2cddc9397..9aaded543216087ea9d38c0ee598b4a146c9621d 100644 (file)
@@ -59,7 +59,7 @@ public class WebLayoutExample extends VerticalLayout {
             Tree tree = new Tree();\r
             tree.setContainerDataSource(ExampleUtil.getHardwareContainer());\r
             tree.setItemCaptionPropertyId(ExampleUtil.hw_PROPERTY_NAME);\r
-            for (Iterator it = tree.rootItemIds().iterator(); it.hasNext();) {\r
+            for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) {\r
                 tree.expandItemsRecursively(it.next());\r
             }\r
             addComponent(tree);\r
index 92f58c78ca8ef0b59c29160535ba2e08ce89b9de..1d81dd12460ba6291b517762801f810c2355bfd4 100644 (file)
@@ -20,7 +20,7 @@ public class PanelBasicExample extends VerticalLayout implements ClickListener {
         panel.setHeight("200px"); // we want scrollbars\r
 \r
         // let's adjust the panels default layout (a VerticalLayout)\r
-        VerticalLayout layout = (VerticalLayout) panel.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) panel.getContent();\r
         layout.setMargin(true); // we want a margin\r
         layout.setSpacing(true); // and spacing between components\r
         addComponent(panel);\r
index 464ab423475035ed5beea848289f0b2ab22d26dd..25fe68c3a0bf8ab1dc4e53d9c713913b18f3fd01 100644 (file)
@@ -23,7 +23,7 @@ public class PanelLightExample extends VerticalLayout implements ClickListener {
         panel.setHeight("200px"); // we want scrollbars\r
 \r
         // let's adjust the panels default layout (a VerticalLayout)\r
-        VerticalLayout layout = (VerticalLayout) panel.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) panel.getContent();\r
         layout.setMargin(true); // we want a margin\r
         layout.setSpacing(true); // and spacing between components\r
         addComponent(panel);\r
index 4abdcae806a463173e30b6985edd976b3c75d5f9..e74e6ab385195b4917ca827808849b5a04ef5f59 100644 (file)
@@ -17,7 +17,7 @@ public class ComboBoxContainsExample extends VerticalLayout implements
 \r
         // Creates a new combobox using an existing container\r
         ComboBox l = new ComboBox("Please select your country", ExampleUtil\r
-                .getStaticISO3166Container());\r
+                .getISO3166Container());\r
 \r
         // Sets the combobox to show a certain property as the item caption\r
         l.setItemCaptionPropertyId(ExampleUtil.iso3166_PROPERTY_NAME);\r
@@ -44,7 +44,7 @@ public class ComboBoxContainsExample extends VerticalLayout implements
      * Shows a notification when a selection is made.\r
      */\r
     public void valueChange(ValueChangeEvent event) {\r
-        Property selected = ExampleUtil.getStaticISO3166Container()\r
+        Property selected = ExampleUtil.getISO3166Container()\r
                 .getContainerProperty(event.getProperty().toString(), "name");\r
         getWindow().showNotification("Selected country: " + selected);\r
     }\r
index 66610a656ad6347bf4ec6a4a8b88237928e80aa4..c98c105557cb1195044e67df690033f337016700 100644 (file)
@@ -17,7 +17,7 @@ public class ComboBoxStartsWithExample extends VerticalLayout implements
 \r
         // Creates a new combobox using an existing container\r
         ComboBox l = new ComboBox("Please select your country", ExampleUtil\r
-                .getStaticISO3166Container());\r
+                .getISO3166Container());\r
 \r
         // Sets the combobox to show a certain property as the item caption\r
         l.setItemCaptionPropertyId(ExampleUtil.iso3166_PROPERTY_NAME);\r
@@ -44,7 +44,7 @@ public class ComboBoxStartsWithExample extends VerticalLayout implements
      * Shows a notification when a selection is made.\r
      */\r
     public void valueChange(ValueChangeEvent event) {\r
-        Property selected = ExampleUtil.getStaticISO3166Container()\r
+        Property selected = ExampleUtil.getISO3166Container()\r
                 .getContainerProperty(event.getProperty().toString(), "name");\r
         getWindow().showNotification("Selected country: " + selected);\r
     }\r
index da4ee3707f9c7da4182da8a2fce5f34dc0ff12f5..bff69f5e9173f34b70e4338e6c2cb30bf1f13e56 100644 (file)
@@ -12,8 +12,9 @@ import com.vaadin.ui.VerticalLayout;
 public class ListSelectSingleExample extends VerticalLayout implements\r
         Property.ValueChangeListener {\r
 \r
-    private static final List cities = Arrays.asList(new String[] { "Berlin",\r
-            "Brussels", "Helsinki", "Madrid", "Oslo", "Paris", "Stockholm" });\r
+    private static final List<String> cities = Arrays.asList(new String[] {\r
+            "Berlin", "Brussels", "Helsinki", "Madrid", "Oslo", "Paris",\r
+            "Stockholm" });\r
 \r
     public ListSelectSingleExample() {\r
         setSpacing(true);\r
index 8d6d0c265903185e9a5c1a1109315898a0a90b7f..6868358ce301429060e70b2a4b4accc3a113ce28 100644 (file)
@@ -138,7 +138,7 @@ public class TableMainFeaturesExample extends VerticalLayout {
             public void valueChange(ValueChangeEvent event) {
                 // in multiselect mode, a Set of itemIds is returned,
                 // in singleselect mode the itemId is returned directly
-                Set value = (Set) event.getProperty().getValue();
+                Set<?> value = (Set<?>) event.getProperty().getValue();
                 if (null == value || value.size() == 0) {
                     selected.setValue("No selection");
                 } else {
index ffc335def40a9d92fa86e41f3665ee1c42384817..7a39fd8da82444465a5b92565f26db9babef53bf 100644 (file)
@@ -26,6 +26,7 @@ public class TabSheetDisabledExample extends VerticalLayout implements
     private VerticalLayout l1;\r
     private VerticalLayout l2;\r
     private VerticalLayout l3;\r
+    @SuppressWarnings("unused")\r
     private Tab t1, t2, t3;\r
 \r
     public TabSheetDisabledExample() {\r
index 17b06bca43119188f06a2ce9c531ba013aa1eba6..0dbff62381121a1dae3c5626e73f0af732f1c903 100644 (file)
@@ -5,6 +5,7 @@ import com.vaadin.ui.Label;
 import com.vaadin.ui.TabSheet;\r
 import com.vaadin.ui.VerticalLayout;\r
 import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;\r
+import com.vaadin.ui.TabSheet.Tab;\r
 \r
 @SuppressWarnings("serial")\r
 public class TabSheetIconsExample extends VerticalLayout implements\r
@@ -47,7 +48,10 @@ public class TabSheetIconsExample extends VerticalLayout implements
     }\r
 \r
     public void selectedTabChange(SelectedTabChangeEvent event) {\r
-        String c = t.getTabCaption(event.getTabSheet().getSelectedTab());\r
-        getWindow().showNotification("Selected tab: " + c);\r
+        TabSheet tabsheet = event.getTabSheet();\r
+        Tab tab = tabsheet.getTab(tabsheet.getSelectedTab());\r
+        if (tab != null) {\r
+            getWindow().showNotification("Selected tab: " + tab.getCaption());\r
+        }\r
     }\r
 }\r
index 41e9b2beba9fe13ef33216f19d6aae4f715ae196..43509ba809f6f462b314f65da4651b216e4d386a 100644 (file)
@@ -5,6 +5,7 @@ import com.vaadin.ui.Label;
 import com.vaadin.ui.TabSheet;\r
 import com.vaadin.ui.VerticalLayout;\r
 import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;\r
+import com.vaadin.ui.TabSheet.Tab;\r
 \r
 @SuppressWarnings("serial")\r
 public class TabSheetScrollingExample extends VerticalLayout implements\r
@@ -55,7 +56,10 @@ public class TabSheetScrollingExample extends VerticalLayout implements
     }\r
 \r
     public void selectedTabChange(SelectedTabChangeEvent event) {\r
-        String c = t.getTabCaption(event.getTabSheet().getSelectedTab());\r
-        getWindow().showNotification("Selected tab: " + c);\r
+        TabSheet tabsheet = event.getTabSheet();\r
+        Tab tab = tabsheet.getTab(tabsheet.getSelectedTab());\r
+        if (tab != null) {\r
+            getWindow().showNotification("Selected tab: " + tab.getCaption());\r
+        }\r
     }\r
 }\r
index f1350e0a70e32a6d6d80e18c916b46664dea30c3..e7e89886b060a7925cc122a8578ac24d7b1c501c 100644 (file)
@@ -41,7 +41,7 @@ public class TreeMultiSelectExample extends VerticalLayout implements
                 Tree t = (Tree) event.getProperty();\r
                 // enable if something is selected, returns a set\r
                 deleteButton.setEnabled(t.getValue() != null\r
-                        && ((Set) t.getValue()).size() > 0);\r
+                        && ((Set<?>) t.getValue()).size() > 0);\r
             }\r
         });\r
 \r
@@ -53,12 +53,13 @@ public class TreeMultiSelectExample extends VerticalLayout implements
         tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);\r
 \r
         // Expand whole tree\r
-        for (Iterator it = tree.rootItemIds().iterator(); it.hasNext();) {\r
+        for (Iterator<?> it = tree.rootItemIds().iterator(); it.hasNext();) {\r
             tree.expandItemsRecursively(it.next());\r
         }\r
 \r
         // Create the 'delete button', inline click-listener\r
         deleteButton = new Button("Delete", new Button.ClickListener() {\r
+            @SuppressWarnings("unchecked")\r
             public void buttonClick(ClickEvent event) {\r
                 // Delete all the selected objects\r
                 Object[] toDelete = ((Set<Object>) tree.getValue()).toArray();\r
index e322f2a208e5bd1cdb5a993f4dd502cae1404140..adff1292b6708e4e1c00dc34a98ebd7a29f528ac 100644 (file)
@@ -58,7 +58,7 @@ public class NativeWindowExample extends VerticalLayout {
     class NativeWindow extends Window {\r
         NativeWindow() {\r
             // Configure the layout\r
-            VerticalLayout layout = (VerticalLayout) getLayout();\r
+            VerticalLayout layout = (VerticalLayout) getContent();\r
             layout.setMargin(true);\r
             layout.setSpacing(true);\r
 \r
index 482682bfebf427e4a6aceb16137350622598f15c..11016fd6f68c0788da4be54ae83be81875a570ea 100644 (file)
@@ -17,7 +17,7 @@ public class SubwindowAutoSizedExample extends VerticalLayout {
         subwindow = new Window("Automatically sized subwindow");\r
 \r
         // Configure the windws layout; by default a VerticalLayout\r
-        VerticalLayout layout = (VerticalLayout) subwindow.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) subwindow.getContent();\r
         layout.setMargin(true);\r
         layout.setSpacing(true);\r
         // make it undefined for auto-sizing window\r
index 2a39508dd73f7ff64c1e886964ae365434c8fa4d..34f886c0a9ea65733421e2e598cc30707f23937c 100644 (file)
@@ -25,7 +25,7 @@ public class SubwindowCloseExample extends VerticalLayout {
         });\r
 \r
         // Configure the windws layout; by default a VerticalLayout\r
-        VerticalLayout layout = (VerticalLayout) subwindow.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) subwindow.getContent();\r
         layout.setMargin(true);\r
         layout.setSpacing(true);\r
 \r
index 307c2a93763ba02665ceb8c4d0c336b25c87b1ae..49c7809e628c467f1ed8f925aa9694d1f0ca28b1 100644 (file)
@@ -17,7 +17,7 @@ public class SubwindowExample extends VerticalLayout {
         subwindow = new Window("A subwindow");\r
 \r
         // Configure the windws layout; by default a VerticalLayout\r
-        VerticalLayout layout = (VerticalLayout) subwindow.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) subwindow.getContent();\r
         layout.setMargin(true);\r
         layout.setSpacing(true);\r
 \r
index 65abf8885f3ecfaff32865a704c5cc37ca7cd840..c698828794988f8b5102a09e9d3a31916e7303c4 100644 (file)
@@ -19,7 +19,7 @@ public class SubwindowModalExample extends VerticalLayout {
         subwindow.setModal(true);\r
 \r
         // Configure the windws layout; by default a VerticalLayout\r
-        VerticalLayout layout = (VerticalLayout) subwindow.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) subwindow.getContent();\r
         layout.setMargin(true);\r
         layout.setSpacing(true);\r
 \r
index dbbc64a571f7fd6f436eaf5216326c3f5e981611..c1712499b8b62e99a52a92178f80bbbf5b6f8b60 100644 (file)
@@ -21,7 +21,7 @@ public class SubwindowPositionedExample extends VerticalLayout {
         subwindow.setHeight("200px");\r
 \r
         // Configure the windws layout; by default a VerticalLayout\r
-        VerticalLayout layout = (VerticalLayout) subwindow.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) subwindow.getContent();\r
         layout.setMargin(true);\r
         layout.setSpacing(true);\r
         // make it fill the whole window\r
index a4d72b0e381e5c8708a270f0e3af4cd900162f47..9cdebb9e83464276ed66b94ab7b42ea1d7cc84be 100644 (file)
@@ -19,7 +19,7 @@ public class SubwindowSizedExample extends VerticalLayout {
         subwindow.setHeight("80%");\r
 \r
         // Configure the windws layout; by default a VerticalLayout\r
-        VerticalLayout layout = (VerticalLayout) subwindow.getLayout();\r
+        VerticalLayout layout = (VerticalLayout) subwindow.getContent();\r
         layout.setMargin(true);\r
         layout.setSpacing(true);\r
         // make it fill the whole window\r