]> source.dussan.org Git - vaadin-framework.git/commitdiff
#2643 fix more demo warnings
authorHenri Sara <henri.sara@itmill.com>
Tue, 26 May 2009 06:04:52 +0000 (06:04 +0000)
committerHenri Sara <henri.sara@itmill.com>
Tue, 26 May 2009 06:04:52 +0000 (06:04 +0000)
svn changeset:8004/svn branch:6.0

17 files changed:
src/com/vaadin/demo/PortletDemo.java
src/com/vaadin/demo/SimpleAddressBook.java
src/com/vaadin/demo/VaadinTunesLayout.java
src/com/vaadin/demo/colorpicker/ColorPicker.java
src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java
src/com/vaadin/demo/coverflow/Coverflow.java
src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java
src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java
src/com/vaadin/demo/reservation/ReservationApplication.java
src/com/vaadin/demo/reservation/ResourceSelectorPanel.java
src/com/vaadin/demo/reservation/gwt/client/ReservationWidgetSet.java
src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java
src/com/vaadin/demo/reservation/simple/SimpleReserver.java
src/com/vaadin/demo/reservation/simple/StdView.java
src/com/vaadin/demo/sampler/ActiveLink.java
src/com/vaadin/demo/sampler/FeatureView.java
src/com/vaadin/demo/sampler/gwt/client/SamplerWidgetSet.java

index 78034f8eac8e4c01d23e35ebe371c1f7f1c187e0..6e3c3d67560d652ad0eac5338df687c4b1d0de0a 100644 (file)
@@ -76,6 +76,7 @@ public class PortletDemo extends Application {
 \r
         }\r
 \r
+        @SuppressWarnings("unchecked")\r
         public void handleRenderRequest(RenderRequest request,\r
                 RenderResponse response) {\r
             // Portlet up-and-running, enable stuff\r
index d9a687feffee4816b6e31242589bf4be32e434aa..22f9c171ed39079c099fa2dacdd9de4b369b6ad0 100644 (file)
@@ -14,13 +14,14 @@ import com.vaadin.ui.VerticalLayout;
 import com.vaadin.ui.Window;
 import com.vaadin.ui.Button.ClickEvent;
 
+@SuppressWarnings("serial")
 public class SimpleAddressBook extends Application {
 
        private static String[] fields = { "First Name", "Last Name", "Company",
                        "Mobile Phone", "Work Phone", "Home Phone", "Work Email",
                        "Home Email", "Street", "Zip", "City", "State", "Country" };
-       private static String[] visibleCols = new String[] { "Last Name", "First Name",
-       "Company" };
+       private static String[] visibleCols = new String[] { "Last Name",
+                       "First Name", "Company" };
 
        private Table contactList = new Table();
        private Form contactEditor = new Form();
@@ -28,6 +29,7 @@ public class SimpleAddressBook extends Application {
        private Button contactRemovalButton;
        private IndexedContainer addressBookData = createDummyData();
 
+       @Override
        public void init() {
                initLayout();
                initContactAddRemoveButtons();
@@ -51,16 +53,17 @@ public class SimpleAddressBook extends Application {
                contactEditor.setImmediate(true);
                bottomLeftCorner.setWidth("100%");
                left.addComponent(bottomLeftCorner);
-       }       
+       }
 
        private void initContactAddRemoveButtons() {
                // New item button
-               bottomLeftCorner.addComponent(new Button("+", new Button.ClickListener() {
-                       public void buttonClick(ClickEvent event) {
-                               Object id = contactList.addItem();
-                               contactList.setValue(id);
-                       }
-               }));
+               bottomLeftCorner.addComponent(new Button("+",
+                               new Button.ClickListener() {
+                                       public void buttonClick(ClickEvent event) {
+                                               Object id = contactList.addItem();
+                                               contactList.setValue(id);
+                                       }
+                               }));
 
                // Remove item button
                contactRemovalButton = new Button("-", new Button.ClickListener() {
@@ -100,15 +103,17 @@ public class SimpleAddressBook extends Application {
                        sf.addListener(new Property.ValueChangeListener() {
                                public void valueChange(ValueChangeEvent event) {
                                        addressBookData.removeContainerFilters(pn);
-                                       if (sf.toString().length() > 0 && !pn.equals(sf.toString()))
+                                       if (sf.toString().length() > 0 && !pn.equals(sf.toString())) {
                                                addressBookData.addContainerFilter(pn, sf.toString(),
                                                                true, false);
+                                       }
                                        getMainWindow().showNotification(
                                                        "" + addressBookData.size() + " matches found");
                                }
                        });
                }
        }
+
        private static IndexedContainer createDummyData() {
 
                String[] fnames = { "Peter", "Alice", "Joshua", "Mike", "Olivia",
@@ -120,8 +125,9 @@ public class SimpleAddressBook extends Application {
 
                IndexedContainer ic = new IndexedContainer();
 
-               for (String p : fields)
+               for (String p : fields) {
                        ic.addContainerProperty(p, String.class, "");
+               }
 
                for (int i = 0; i < 1000; i++) {
                        Object id = ic.addItem();
index 6b82e53e0a522d2749d3d661a5bfca3272f493d7..02187563d28baf9df98e292f0484178b0ed75f36 100644 (file)
@@ -36,7 +36,8 @@ public class VaadinTunesLayout extends Application {
          */
 
         // Main (browser) window, needed in all Vaadin applications
-        final Window root = new Window("VaadinTunes");
+        VerticalLayout rootLayout = new VerticalLayout();
+        final Window root = new Window("VaadinTunes", rootLayout);
 
         /*
          * We'll attach the window to the browser view already here, so we won't
@@ -49,10 +50,10 @@ public class VaadinTunesLayout extends Application {
                         "This is an example of how you can do layouts in Vaadin.<br/>It is not a working sound player.",
                         Notification.TYPE_HUMANIZED_MESSAGE);
 
-        // Our root window contains one VerticalLayout by default, let's make
+        // Our root window contains one VerticalLayout, let's make
         // sure it's 100% sized, and remove unwanted margins
-        root.getContent().setSizeFull();
-        root.getLayout().setMargin(false);
+        rootLayout.setSizeFull();
+        rootLayout.setMargin(false);
 
         // Top area, containing playback and volume controls, play status, view
         // modes and search
index 99a3abd37a55a9dc4690221057b18039425b5b87..a811d7ac92a94e035e0b14c83afa320e032a67be 100644 (file)
@@ -20,7 +20,7 @@ public class ColorPicker extends AbstractField {
 
     /** The property value of the field is a String. */
     @Override
-    public Class getType() {
+    public Class<?> getType() {
         return String.class;
     }
 
@@ -55,6 +55,7 @@ public class ColorPicker extends AbstractField {
     }
 
     /** Deserialize changes received from client. */
+    @SuppressWarnings("unchecked")
     @Override
     public void changeVariables(Object source, Map variables) {
         // Sets the currently selected color
index ed6b32b6cd639adc591a71eb4cb1c70f737a0649..2c924c0239cde370f9865d3527efb2cc5b9505e7 100644 (file)
@@ -12,7 +12,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
 public class ColorPickerWidgetSet extends DefaultWidgetSet {\r
     /** Resolves UIDL tag name to widget class. */\r
     @Override\r
-    protected Class resolveWidgetType(UIDL uidl) {\r
+    protected Class<?> resolveWidgetType(UIDL uidl) {\r
         final String tag = uidl.getTag();\r
         if ("colorpicker".equals(tag)) {\r
             return VColorPicker.class;\r
@@ -25,7 +25,7 @@ public class ColorPickerWidgetSet extends DefaultWidgetSet {
     /** Creates a widget instance according to its class object. */\r
     @Override\r
     public Paintable createWidget(UIDL uidl) {\r
-        final Class type = resolveWidgetType(uidl);\r
+        final Class<?> type = resolveWidgetType(uidl);\r
         if (VColorPicker.class == type) {\r
             return new VColorPicker();\r
         }\r
index dfd2b4fbe670b2685f85dca8d5525e49149c0f9c..149cf6e3837f1d541e28214f7fbd3fe87d83bef2 100644 (file)
@@ -8,7 +8,7 @@ import com.vaadin.terminal.PaintException;
 import com.vaadin.terminal.PaintTarget;
 import com.vaadin.ui.AbstractSelect;
 
-@SuppressWarnings("serial")
+@SuppressWarnings( { "serial", "unchecked" })
 public class Coverflow extends AbstractSelect {
 
     private String backgroundGradientStart = "FFFFFF";
index b6f0434f3e53d6fb56c95ce8dc516e3dce00a2b5..bbde2525405e4cbf8c7031ffce7d16209f02825d 100644 (file)
@@ -13,7 +13,7 @@ public class CoverflowWidgetSet extends DefaultWidgetSet {
     /** Creates a widget according to its class name. */
     @Override
     public Paintable createWidget(UIDL uidl) {
-        final Class classType = resolveWidgetType(uidl);
+        final Class<?> classType = resolveWidgetType(uidl);
         if (VCoverflow.class == classType) {
             return new VCoverflow();
         }
@@ -24,7 +24,7 @@ public class CoverflowWidgetSet extends DefaultWidgetSet {
 
     /** Resolves UIDL tag name to class . */
     @Override
-    protected Class resolveWidgetType(UIDL uidl) {
+    protected Class<?> resolveWidgetType(UIDL uidl) {
         final String tag = uidl.getTag();
         if ("cover".equals(tag)) {
             return VCoverflow.class;
index 35a7118fb0f2f33b2a6a79e18053f8e7ee5f4772..fb54a1445c9858c664c542466d29602be7a2ff60 100644 (file)
@@ -18,7 +18,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
 public class VCoverflow extends Composite implements Paintable {
     private String uidlId;
     protected ApplicationConnection client;
-    private ArrayList coverList = new ArrayList();
+    private ArrayList<HashMap<String, String>> coverList = new ArrayList<HashMap<String, String>>();
 
     private Object _selected;
     private boolean flashInited = false;
@@ -28,7 +28,7 @@ public class VCoverflow extends Composite implements Paintable {
     private String backgroundGradientEnd;
     private boolean colorChanged = false;
     private boolean sbVisibilityChanged = false;
-    private HashMap keyMap = new HashMap();
+    private HashMap<String, String> keyMap = new HashMap<String, String>();
 
     /**
      * Constructor
@@ -96,16 +96,16 @@ public class VCoverflow extends Composite implements Paintable {
         // should
         // be deleted.
 
-        ArrayList newList = new ArrayList();
+        ArrayList<HashMap<String, String>> newList = new ArrayList<HashMap<String, String>>();
 
         // Iterate through all option elements
-        for (final Iterator i = images.getChildIterator(); i.hasNext();) {
+        for (final Iterator<Object> i = images.getChildIterator(); i.hasNext();) {
             final UIDL imgUidl = (UIDL) i.next();
 
             // Make sure all required attributes exist
             if (imgUidl.hasAttribute("caption") && imgUidl.hasAttribute("key")
                     && imgUidl.hasAttribute("icon")) {
-                HashMap set = new HashMap();
+                HashMap<String, String> set = new HashMap<String, String>();
 
                 // Update the key map
                 keyMap.put(imgUidl.getStringAttribute("caption"), imgUidl
@@ -127,27 +127,26 @@ public class VCoverflow extends Composite implements Paintable {
         }
 
         // Deleted items
-        ArrayList intersectList = new ArrayList();
+        ArrayList<HashMap<String, String>> intersectList = new ArrayList<HashMap<String, String>>();
         intersectList.addAll(coverList);
         intersectList.removeAll(newList);
 
         if (flashInited) {
             for (int i = 0; i < intersectList.size(); i++) {
-                HashMap cover = (HashMap) intersectList.get(i);
-                removeCover(uidlId, cover.get("caption").toString());
+                HashMap<String, String> cover = intersectList.get(i);
+                removeCover(uidlId, cover.get("caption"));
             }
         }
 
         // Added items
-        intersectList = new ArrayList();
+        intersectList = new ArrayList<HashMap<String, String>>();
         intersectList.addAll(newList);
         intersectList.removeAll(coverList);
 
         if (flashInited) {
             for (int i = 0; i < intersectList.size(); i++) {
-                HashMap cover = (HashMap) intersectList.get(i);
-                addCover(uidlId, cover.get("caption").toString(), cover.get(
-                        "icon").toString());
+                HashMap<String, String> cover = intersectList.get(i);
+                addCover(uidlId, cover.get("caption"), cover.get("icon"));
             }
         }
 
@@ -189,8 +188,8 @@ public class VCoverflow extends Composite implements Paintable {
             return;
         }
 
-        client.updateVariable(uidlId, "selected", new String[] { keyMap.get(
-                coverId).toString() }, true);
+        client.updateVariable(uidlId, "selected", new String[] { keyMap
+                .get(coverId) }, true);
     }
 
     /**
@@ -201,23 +200,23 @@ public class VCoverflow extends Composite implements Paintable {
      *            id
      */
     public native void initializeMethods(String id) /*-{
-                var app = this;
-                
-                if($wnd.vaadin.coverflow == null)
-                       var coverflow = [];
-                else
-                       var coverflow = $wnd.vaadin.coverflow;
-                       
-                coverflow['getCovers_' + id] = function() {                
-                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::getCovers()();
-                };   
-                
-                       coverflow['setCurrent_' + id] = function(selected) {
-                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::setCover(Ljava/lang/String;)(selected);
-                };
-                
-                $wnd.vaadin.coverflow = coverflow;
-            }-*/;
+                                                 var app = this;
+                                                 
+                                                 if($wnd.vaadin.coverflow == null)
+                                                       var coverflow = [];
+                                                 else
+                                                       var coverflow = $wnd.vaadin.coverflow;
+                                                       
+                                                 coverflow['getCovers_' + id] = function() {                
+                                                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::getCovers()();
+                                                 };   
+                                                 
+                                                       coverflow['setCurrent_' + id] = function(selected) {
+                                                       app.@com.vaadin.demo.coverflow.gwt.client.ui.VCoverflow::setCover(Ljava/lang/String;)(selected);
+                                                 };
+                                                 
+                                                 $wnd.vaadin.coverflow = coverflow;
+                                             }-*/;
 
     /**
      * This function sends all covers to the flash. We cannot do this directly
@@ -226,14 +225,13 @@ public class VCoverflow extends Composite implements Paintable {
      * it's ready.
      */
     public void getCovers() {
-        // Loop through all stored coves
+        // Loop through all stored covers
         for (int i = 0; i < coverList.size(); i++) {
-            HashMap set = (HashMap) coverList.get(i);
+            HashMap<String, String> set = coverList.get(i);
 
             try {
                 // Add the cover
-                addCover(uidlId, set.get("caption").toString(), set.get("icon")
-                        .toString());
+                addCover(uidlId, set.get("caption"), set.get("icon"));
             } catch (Exception e) {
                 // Do not add covers lacking obligatory data
             }
@@ -259,14 +257,14 @@ public class VCoverflow extends Composite implements Paintable {
      * @param icon
      */
     public native void addCover(String id, String caption, String icon) /*-{   
-                try {
-                           $doc['fxcoverflow' + id].addCover(caption.toString(), icon.toString());
-                    }
-                    catch(e) {
-                        $wnd.alert(e.message);
-                    }   
-                       
-                }-*/;
+                                                 try {
+                                                           $doc['fxcoverflow' + id].addCover(caption.toString(), icon.toString());
+                                                     }
+                                                     catch(e) {
+                                                         $wnd.alert(e.message);
+                                                     }   
+                                                       
+                                                 }-*/;
 
     /**
      * This function tells the flash which cover should be selected.
@@ -275,21 +273,21 @@ public class VCoverflow extends Composite implements Paintable {
      * @param key
      */
     public native void selectCover(String id, String key) /*-{    
-               $doc["fxcoverflow" + id].selectCover(key.toString());
-             }-*/;
+                                               $doc["fxcoverflow" + id].selectCover(key.toString());
+                                              }-*/;
 
     public native void setBackgroundColor(String id, String startGradient,
             String endGradient) /*-{           
-                       $doc["fxcoverflow" + id].setBackgroundColor("0x" + startGradient.toString(), "0x" + endGradient.toString());
-            }-*/;
+                                                       $doc["fxcoverflow" + id].setBackgroundColor("0x" + startGradient.toString(), "0x" + endGradient.toString());
+                                             }-*/;
 
     public native void toggleScrollbarVisibility(String id, boolean visibility) /*-{           
-               $doc["fxcoverflow" + id].toggleScrollbarVisibility(visibility);
-             }-*/;
+                                               $doc["fxcoverflow" + id].toggleScrollbarVisibility(visibility);
+                                              }-*/;
 
     public native void removeCover(String id, String key) /*-{         
-               $doc["fxcoverflow" + id].removeCover(key);
-             }-*/;
+                                               $doc["fxcoverflow" + id].removeCover(key);
+                                              }-*/;
 
     /**
      * Set the HTML coding of the flash movie. This isn't done until the
index 6f0a8e9cc22a7c75538d5b38c7e4e43550c5606e..631233cdf3db17ce32e3f5aa2b3c10d168b07cf0 100644 (file)
@@ -9,7 +9,6 @@ import java.util.Calendar;
 import java.util.Date;\r
 import java.util.Iterator;\r
 import java.util.LinkedList;\r
-import java.util.List;\r
 \r
 import com.vaadin.Application;\r
 import com.vaadin.data.Container;\r
@@ -88,10 +87,11 @@ public class ReservationApplication extends Application {
                 this, "selectedResourcesChanged");\r
         reservationTab.addComponent(resourcePanel);\r
 \r
+        HorizontalLayout reservationLayout = new HorizontalLayout();\r
         final Panel reservationPanel = new Panel("Reservation",\r
-                new HorizontalLayout());\r
+                reservationLayout);\r
         reservationPanel.addStyleName(Panel.STYLE_LIGHT);\r
-        reservationPanel.getLayout().setMargin(true);\r
+        reservationLayout.setMargin(true);\r
         reservationTab.addComponent(reservationPanel);\r
 \r
         final VerticalLayout infoLayout = new VerticalLayout();\r
@@ -230,10 +230,10 @@ public class ReservationApplication extends Application {
     }\r
 \r
     private Item getActiveResource() throws ResourceNotAvailableException {\r
-        final List rids = resourcePanel.getSelectedResources();\r
+        final LinkedList<Item> rids = resourcePanel.getSelectedResources();\r
         if (rids != null && rids.size() > 0) {\r
-            for (final Iterator it = rids.iterator(); it.hasNext();) {\r
-                final Item resource = (Item) it.next();\r
+            for (final Iterator<Item> it = rids.iterator(); it.hasNext();) {\r
+                final Item resource = it.next();\r
                 final int id = ((Integer) resource.getItemProperty(\r
                         SampleDB.Resource.PROPERTY_ID_ID).getValue())\r
                         .intValue();\r
@@ -296,9 +296,9 @@ public class ReservationApplication extends Application {
             resourceName.setCaption(name);\r
             resourceName.setValue(desc);\r
             // Put all resources on map (may be many if category was selected)\r
-            final LinkedList srs = resourcePanel.getSelectedResources();\r
-            for (final Iterator it = srs.iterator(); it.hasNext();) {\r
-                resource = (Item) it.next();\r
+            final LinkedList<Item> srs = resourcePanel.getSelectedResources();\r
+            for (final Iterator<Item> it = srs.iterator(); it.hasNext();) {\r
+                resource = it.next();\r
                 name = (String) resource.getItemProperty(\r
                         SampleDB.Resource.PROPERTY_ID_NAME).getValue();\r
                 desc = (String) resource.getItemProperty(\r
index a99cb239407bbd8bbe6caf335b428f1c66398ad6..2b4047722aba894d1f9af8552edffda47eb7f278 100644 (file)
@@ -17,14 +17,14 @@ import com.vaadin.ui.Panel;
 import com.vaadin.ui.VerticalLayout;\r
 import com.vaadin.ui.Button.ClickEvent;\r
 \r
-@SuppressWarnings( { "serial", "unchecked" })\r
+@SuppressWarnings("serial")\r
 public class ResourceSelectorPanel extends Panel implements\r
         Button.ClickListener {\r
-    private final HashMap categoryLayouts = new HashMap();\r
-    private final HashMap categoryResources = new HashMap();\r
+    private final HashMap<String, Layout> categoryLayouts = new HashMap<String, Layout>();\r
+    private final HashMap<String, LinkedList<Item>> categoryResources = new HashMap<String, LinkedList<Item>>();\r
 \r
     // private Container allResources;\r
-    private LinkedList selectedResources = null;\r
+    private LinkedList<Item> selectedResources = null;\r
 \r
     public ResourceSelectorPanel(String caption) {\r
         super(caption, new HorizontalLayout());\r
@@ -38,7 +38,7 @@ public class ResourceSelectorPanel extends Panel implements
         categoryLayouts.clear();\r
         categoryResources.clear();\r
         if (resources != null && resources.size() > 0) {\r
-            for (final Iterator it = resources.getItemIds().iterator(); it\r
+            for (final Iterator<?> it = resources.getItemIds().iterator(); it\r
                     .hasNext();) {\r
                 final Item resource = resources.getItem(it.next());\r
                 // final Integer id = (Integer) resource.getItemProperty(\r
@@ -53,16 +53,15 @@ public class ResourceSelectorPanel extends Panel implements
                 rButton.setStyleName("link");\r
                 rButton.setDescription(description);\r
                 rButton.setData(resource);\r
-                Layout resourceLayout = (Layout) categoryLayouts.get(category);\r
-                LinkedList resourceList = (LinkedList) categoryResources\r
-                        .get(category);\r
+                Layout resourceLayout = categoryLayouts.get(category);\r
+                LinkedList<Item> resourceList = categoryResources.get(category);\r
                 if (resourceLayout == null) {\r
                     resourceLayout = new VerticalLayout();\r
                     resourceLayout.setSizeUndefined();\r
                     resourceLayout.setMargin(true);\r
                     addComponent(resourceLayout);\r
                     categoryLayouts.put(category, resourceLayout);\r
-                    resourceList = new LinkedList();\r
+                    resourceList = new LinkedList<Item>();\r
                     categoryResources.put(category, resourceList);\r
                     final Button cButton = new Button(category + " (any)", this);\r
                     cButton.setStyleName("important-link");\r
@@ -75,12 +74,12 @@ public class ResourceSelectorPanel extends Panel implements
         }\r
     }\r
 \r
-    // Selects one initial categore, inpractice randomly\r
+    // Selects one initial category, in practice randomly\r
     public void selectFirstCategory() {\r
         try {\r
-            final Object catId = categoryResources.keySet().iterator().next();\r
-            final LinkedList res = (LinkedList) categoryResources.get(catId);\r
-            final Layout l = (Layout) categoryLayouts.get(catId);\r
+            final String catId = categoryResources.keySet().iterator().next();\r
+            final LinkedList<Item> res = categoryResources.get(catId);\r
+            final Layout l = categoryLayouts.get(catId);\r
             final Button catB = (Button) l.getComponentIterator().next();\r
             setSelectedResources(res);\r
             catB.setStyleName("selected-link");\r
@@ -89,12 +88,12 @@ public class ResourceSelectorPanel extends Panel implements
         }\r
     }\r
 \r
-    private void setSelectedResources(LinkedList resources) {\r
+    private void setSelectedResources(LinkedList<Item> resources) {\r
         selectedResources = resources;\r
         fireEvent(new SelectedResourcesChangedEvent());\r
     }\r
 \r
-    public LinkedList getSelectedResources() {\r
+    public LinkedList<Item> getSelectedResources() {\r
         return selectedResources;\r
     }\r
 \r
@@ -104,12 +103,12 @@ public class ResourceSelectorPanel extends Panel implements
             final Object data = ((Button) source).getData();\r
             resetStyles();\r
             if (data instanceof Item) {\r
-                final LinkedList rlist = new LinkedList();\r
-                rlist.add(data);\r
+                final LinkedList<Item> rlist = new LinkedList<Item>();\r
+                rlist.add((Item) data);\r
                 setSelectedResources(rlist);\r
             } else {\r
                 final String category = (String) data;\r
-                final LinkedList resources = (LinkedList) categoryResources\r
+                final LinkedList<Item> resources = categoryResources\r
                         .get(category);\r
                 setSelectedResources(resources);\r
             }\r
@@ -119,10 +118,11 @@ public class ResourceSelectorPanel extends Panel implements
     }\r
 \r
     private void resetStyles() {\r
-        for (final Iterator it = categoryLayouts.values().iterator(); it\r
+        for (final Iterator<Layout> it = categoryLayouts.values().iterator(); it\r
                 .hasNext();) {\r
-            final Layout lo = (Layout) it.next();\r
-            for (final Iterator bit = lo.getComponentIterator(); bit.hasNext();) {\r
+            final Layout lo = it.next();\r
+            for (final Iterator<?> bit = lo.getComponentIterator(); bit\r
+                    .hasNext();) {\r
                 final Button b = (Button) bit.next();\r
                 if (b.getData() instanceof Item) {\r
                     b.setStyleName("link");\r
index 01577a6917876b121f48da1441bc58fdd88f30b2..2520098aed232905d9d30b4d70f41dd85e3822d3 100644 (file)
@@ -13,7 +13,7 @@ import com.vaadin.terminal.gwt.client.UIDL;
 public class ReservationWidgetSet extends DefaultWidgetSet {\r
     @Override\r
     public Paintable createWidget(UIDL uidl) {\r
-        final Class type = resolveWidgetType(uidl);\r
+        final Class<?> type = resolveWidgetType(uidl);\r
         if (VGoogleMap.class == type) {\r
             return new VGoogleMap();\r
         } else if (VCalendarField.class == type) {\r
@@ -24,7 +24,7 @@ public class ReservationWidgetSet extends DefaultWidgetSet {
     }\r
 \r
     @Override\r
-    protected Class resolveWidgetType(UIDL uidl) {\r
+    protected Class<?> resolveWidgetType(UIDL uidl) {\r
         final String tag = uidl.getTag();\r
         if ("googlemap".equals(tag)) {\r
             return VGoogleMap.class;\r
index e6150c39b7ebfce62ee1836f516d2d0ee3ff732d..48d7d4b7f2daaf6d999f16c7667b8e91d77e96bb 100644 (file)
@@ -35,11 +35,12 @@ public class VGoogleMap extends Composite implements Paintable {
     public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {\r
         widget.clearOverlays();\r
         LatLng pos = null;\r
-        for (final Iterator it = uidl.getChildIterator(); it.hasNext();) {\r
+        for (final Iterator<Object> it = uidl.getChildIterator(); it.hasNext();) {\r
             final UIDL u = (UIDL) it.next();\r
             if (u.getTag().equals("markers")) {\r
 \r
-                for (final Iterator m = u.getChildIterator(); m.hasNext();) {\r
+                for (final Iterator<Object> m = u.getChildIterator(); m\r
+                        .hasNext();) {\r
                     final UIDL umarker = (UIDL) m.next();\r
                     final String html = "<span>"\r
                             + umarker.getStringAttribute("html") + "</span>";\r
index 9ad8a0e842481a782659a5df2da9ec1e539f93b5..d2dd8bb45a9fdf7684ec9e67857acc98852ebc91 100644 (file)
@@ -15,6 +15,7 @@ import com.vaadin.terminal.gwt.server.PortletApplicationContext;
 import com.vaadin.terminal.gwt.server.PortletApplicationContext.PortletListener;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.ComponentContainer;
+import com.vaadin.ui.VerticalLayout;
 import com.vaadin.ui.Window;
 import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.Button.ClickListener;
@@ -45,7 +46,8 @@ public class SimpleReserver extends Application {
 
     @Override
     public void init() {
-        final Window w = new Window("Simple Reserver");
+        VerticalLayout rootLayout = new VerticalLayout();
+        final Window w = new Window("Simple Reserver", rootLayout);
         w.addStyleName("simplereserver");
 
         if (getContext() instanceof PortletApplicationContext) {
@@ -79,7 +81,7 @@ public class SimpleReserver extends Application {
             });
             w.setTheme("liferay");
             // portal will deal outer margins
-            w.getLayout().setMargin(false);
+            rootLayout.setMargin(false);
         } else {
             w.setTheme("reservr");
         }
index 41d24a75f4c78b663a1e6c66d68f8e4743f502fd..252e668ee50fc61278191260ad4277540aa9e4d2 100644 (file)
@@ -88,7 +88,7 @@ public class StdView extends VerticalLayout {
             add.setEnabled(false);
             reservations.setEnabled(false);
         } else {
-            List resource = new LinkedList();
+            List<Item> resource = new LinkedList<Item>();
             resource.add(resources.getItem(resources.getValue()));
             final Container res = application.getDb().getReservations(resource);
             reservations.setContainerDataSource(res);
index 375728aafc894b637e19d76d32010239aafb163f..9b6a47cb3b5d79f47198d81fc43e51e68f274447 100644 (file)
@@ -11,7 +11,6 @@ import com.vaadin.terminal.Resource;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.Link;
 import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
 
 @SuppressWarnings("serial")
 public class ActiveLink extends Link {
@@ -20,7 +19,7 @@ public class ActiveLink extends Link {
 
     private static final Method LINK_FOLLOWED_METHOD;
 
-    private HashSet listeners = new HashSet();
+    private HashSet<LinkActivatedListener> listeners = new HashSet<LinkActivatedListener>();
 
     public ActiveLink() {
         super();
@@ -72,7 +71,7 @@ public class ActiveLink extends Link {
      * @param listener
      *            the Listener to be removed.
      */
-    public void removeListener(ClickListener listener) {
+    public void removeListener(LinkActivatedListener listener) {
         listeners.remove(listener);
         removeListener(ClickEvent.class, listener, LINK_FOLLOWED_METHOD);
         if (listeners.size() == 0) {
@@ -97,6 +96,7 @@ public class ActiveLink extends Link {
         }
     }
 
+    @SuppressWarnings("unchecked")
     @Override
     public void changeVariables(Object source, Map variables) {
         super.changeVariables(source, variables);
index af7c00215e319cfab0a3f815f2574a078723e616..f9a54328b2d45c7adccd6df4ee20933c1aa582c6 100644 (file)
@@ -49,8 +49,9 @@ public class FeatureView extends HorizontalLayout {
         addComponent(left);
         setExpandRatio(left, 1);
 
-        right = new Panel();
-        right.getLayout().setMargin(true, false, false, false);
+        VerticalLayout rightLayout = new VerticalLayout();
+        right = new Panel(rightLayout);
+        rightLayout.setMargin(true, false, false, false);
         right.setStyleName(Panel.STYLE_LIGHT);
         right.addStyleName("feature-info");
         right.setWidth("369px");
@@ -213,7 +214,7 @@ public class FeatureView extends HorizontalLayout {
                 caption.setWidth("100%");
                 rel.addComponent(caption);
                 rel.setMargin(false, false, true, false);
-                for (Class c : features) {
+                for (Class<? extends Feature> c : features) {
                     final Feature f = SamplerApplication.getFeatureFor(c);
                     if (f != null) {
                         String path = SamplerApplication.getPathFor(f);
index 24dde94a3ccf45d18b25af1024104b52883836ec..69942f6e5002b585c4df6de164321edad03515ee 100644 (file)
@@ -11,7 +11,7 @@ public class SamplerWidgetSet extends DefaultWidgetSet {
 
     @Override
     public Paintable createWidget(UIDL uidl) {
-        final Class classType = resolveWidgetType(uidl);
+        final Class<?> classType = resolveWidgetType(uidl);
         if (VGoogleAnalytics.class == classType) {
             return new VGoogleAnalytics();
         } else if (VCodeLabel.class == classType) {
@@ -24,7 +24,7 @@ public class SamplerWidgetSet extends DefaultWidgetSet {
     }
 
     @Override
-    protected Class resolveWidgetType(UIDL uidl) {
+    protected Class<?> resolveWidgetType(UIDL uidl) {
         final String tag = uidl.getTag();
         if ("googleanalytics".equals(tag)) {
             return VGoogleAnalytics.class;