From 60ded086c39abd88e8e6ba1b5be3ded78bc54dc2 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Tue, 26 May 2009 06:04:52 +0000 Subject: [PATCH] #2643 fix more demo warnings svn changeset:8004/svn branch:6.0 --- src/com/vaadin/demo/PortletDemo.java | 1 + src/com/vaadin/demo/SimpleAddressBook.java | 28 +++-- src/com/vaadin/demo/VaadinTunesLayout.java | 9 +- .../vaadin/demo/colorpicker/ColorPicker.java | 3 +- .../gwt/client/ColorPickerWidgetSet.java | 4 +- src/com/vaadin/demo/coverflow/Coverflow.java | 2 +- .../gwt/client/CoverflowWidgetSet.java | 4 +- .../coverflow/gwt/client/ui/VCoverflow.java | 100 +++++++++--------- .../reservation/ReservationApplication.java | 18 ++-- .../reservation/ResourceSelectorPanel.java | 42 ++++---- .../gwt/client/ReservationWidgetSet.java | 4 +- .../reservation/gwt/client/ui/VGoogleMap.java | 5 +- .../reservation/simple/SimpleReserver.java | 6 +- .../demo/reservation/simple/StdView.java | 2 +- src/com/vaadin/demo/sampler/ActiveLink.java | 6 +- src/com/vaadin/demo/sampler/FeatureView.java | 7 +- .../sampler/gwt/client/SamplerWidgetSet.java | 4 +- 17 files changed, 128 insertions(+), 117 deletions(-) diff --git a/src/com/vaadin/demo/PortletDemo.java b/src/com/vaadin/demo/PortletDemo.java index 78034f8eac..6e3c3d6756 100644 --- a/src/com/vaadin/demo/PortletDemo.java +++ b/src/com/vaadin/demo/PortletDemo.java @@ -76,6 +76,7 @@ public class PortletDemo extends Application { } + @SuppressWarnings("unchecked") public void handleRenderRequest(RenderRequest request, RenderResponse response) { // Portlet up-and-running, enable stuff diff --git a/src/com/vaadin/demo/SimpleAddressBook.java b/src/com/vaadin/demo/SimpleAddressBook.java index d9a687feff..22f9c171ed 100644 --- a/src/com/vaadin/demo/SimpleAddressBook.java +++ b/src/com/vaadin/demo/SimpleAddressBook.java @@ -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(); diff --git a/src/com/vaadin/demo/VaadinTunesLayout.java b/src/com/vaadin/demo/VaadinTunesLayout.java index 6b82e53e0a..02187563d2 100644 --- a/src/com/vaadin/demo/VaadinTunesLayout.java +++ b/src/com/vaadin/demo/VaadinTunesLayout.java @@ -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.
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 diff --git a/src/com/vaadin/demo/colorpicker/ColorPicker.java b/src/com/vaadin/demo/colorpicker/ColorPicker.java index 99a3abd37a..a811d7ac92 100644 --- a/src/com/vaadin/demo/colorpicker/ColorPicker.java +++ b/src/com/vaadin/demo/colorpicker/ColorPicker.java @@ -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 diff --git a/src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java b/src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java index ed6b32b6cd..2c924c0239 100644 --- a/src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java +++ b/src/com/vaadin/demo/colorpicker/gwt/client/ColorPickerWidgetSet.java @@ -12,7 +12,7 @@ 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) { + protected Class resolveWidgetType(UIDL uidl) { final String tag = uidl.getTag(); if ("colorpicker".equals(tag)) { return VColorPicker.class; @@ -25,7 +25,7 @@ public class ColorPickerWidgetSet extends DefaultWidgetSet { /** Creates a widget instance according to its class object. */ @Override public Paintable createWidget(UIDL uidl) { - final Class type = resolveWidgetType(uidl); + final Class type = resolveWidgetType(uidl); if (VColorPicker.class == type) { return new VColorPicker(); } diff --git a/src/com/vaadin/demo/coverflow/Coverflow.java b/src/com/vaadin/demo/coverflow/Coverflow.java index dfd2b4fbe6..149cf6e383 100644 --- a/src/com/vaadin/demo/coverflow/Coverflow.java +++ b/src/com/vaadin/demo/coverflow/Coverflow.java @@ -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"; diff --git a/src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java b/src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java index b6f0434f3e..bbde252540 100644 --- a/src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java +++ b/src/com/vaadin/demo/coverflow/gwt/client/CoverflowWidgetSet.java @@ -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; diff --git a/src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java b/src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java index 35a7118fb0..fb54a1445c 100644 --- a/src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java +++ b/src/com/vaadin/demo/coverflow/gwt/client/ui/VCoverflow.java @@ -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> coverList = new ArrayList>(); 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 keyMap = new HashMap(); /** * Constructor @@ -96,16 +96,16 @@ public class VCoverflow extends Composite implements Paintable { // should // be deleted. - ArrayList newList = new ArrayList(); + ArrayList> newList = new ArrayList>(); // Iterate through all option elements - for (final Iterator i = images.getChildIterator(); i.hasNext();) { + for (final Iterator 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 set = new HashMap(); // 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> intersectList = new ArrayList>(); 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 cover = intersectList.get(i); + removeCover(uidlId, cover.get("caption")); } } // Added items - intersectList = new ArrayList(); + intersectList = new ArrayList>(); 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 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 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 diff --git a/src/com/vaadin/demo/reservation/ReservationApplication.java b/src/com/vaadin/demo/reservation/ReservationApplication.java index 6f0a8e9cc2..631233cdf3 100644 --- a/src/com/vaadin/demo/reservation/ReservationApplication.java +++ b/src/com/vaadin/demo/reservation/ReservationApplication.java @@ -9,7 +9,6 @@ import java.util.Calendar; import java.util.Date; import java.util.Iterator; import java.util.LinkedList; -import java.util.List; import com.vaadin.Application; import com.vaadin.data.Container; @@ -88,10 +87,11 @@ public class ReservationApplication extends Application { this, "selectedResourcesChanged"); reservationTab.addComponent(resourcePanel); + HorizontalLayout reservationLayout = new HorizontalLayout(); final Panel reservationPanel = new Panel("Reservation", - new HorizontalLayout()); + reservationLayout); reservationPanel.addStyleName(Panel.STYLE_LIGHT); - reservationPanel.getLayout().setMargin(true); + reservationLayout.setMargin(true); reservationTab.addComponent(reservationPanel); final VerticalLayout infoLayout = new VerticalLayout(); @@ -230,10 +230,10 @@ public class ReservationApplication extends Application { } private Item getActiveResource() throws ResourceNotAvailableException { - final List rids = resourcePanel.getSelectedResources(); + final LinkedList rids = resourcePanel.getSelectedResources(); if (rids != null && rids.size() > 0) { - for (final Iterator it = rids.iterator(); it.hasNext();) { - final Item resource = (Item) it.next(); + for (final Iterator it = rids.iterator(); it.hasNext();) { + final Item resource = it.next(); final int id = ((Integer) resource.getItemProperty( SampleDB.Resource.PROPERTY_ID_ID).getValue()) .intValue(); @@ -296,9 +296,9 @@ public class ReservationApplication extends Application { resourceName.setCaption(name); resourceName.setValue(desc); // Put all resources on map (may be many if category was selected) - final LinkedList srs = resourcePanel.getSelectedResources(); - for (final Iterator it = srs.iterator(); it.hasNext();) { - resource = (Item) it.next(); + final LinkedList srs = resourcePanel.getSelectedResources(); + for (final Iterator it = srs.iterator(); it.hasNext();) { + resource = it.next(); name = (String) resource.getItemProperty( SampleDB.Resource.PROPERTY_ID_NAME).getValue(); desc = (String) resource.getItemProperty( diff --git a/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java b/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java index a99cb23940..2b4047722a 100644 --- a/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java +++ b/src/com/vaadin/demo/reservation/ResourceSelectorPanel.java @@ -17,14 +17,14 @@ import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Button.ClickEvent; -@SuppressWarnings( { "serial", "unchecked" }) +@SuppressWarnings("serial") public class ResourceSelectorPanel extends Panel implements Button.ClickListener { - private final HashMap categoryLayouts = new HashMap(); - private final HashMap categoryResources = new HashMap(); + private final HashMap categoryLayouts = new HashMap(); + private final HashMap> categoryResources = new HashMap>(); // private Container allResources; - private LinkedList selectedResources = null; + private LinkedList selectedResources = null; public ResourceSelectorPanel(String caption) { super(caption, new HorizontalLayout()); @@ -38,7 +38,7 @@ public class ResourceSelectorPanel extends Panel implements categoryLayouts.clear(); categoryResources.clear(); if (resources != null && resources.size() > 0) { - for (final Iterator it = resources.getItemIds().iterator(); it + for (final Iterator it = resources.getItemIds().iterator(); it .hasNext();) { final Item resource = resources.getItem(it.next()); // final Integer id = (Integer) resource.getItemProperty( @@ -53,16 +53,15 @@ public class ResourceSelectorPanel extends Panel implements rButton.setStyleName("link"); rButton.setDescription(description); rButton.setData(resource); - Layout resourceLayout = (Layout) categoryLayouts.get(category); - LinkedList resourceList = (LinkedList) categoryResources - .get(category); + Layout resourceLayout = categoryLayouts.get(category); + LinkedList resourceList = categoryResources.get(category); if (resourceLayout == null) { resourceLayout = new VerticalLayout(); resourceLayout.setSizeUndefined(); resourceLayout.setMargin(true); addComponent(resourceLayout); categoryLayouts.put(category, resourceLayout); - resourceList = new LinkedList(); + resourceList = new LinkedList(); categoryResources.put(category, resourceList); final Button cButton = new Button(category + " (any)", this); cButton.setStyleName("important-link"); @@ -75,12 +74,12 @@ public class ResourceSelectorPanel extends Panel implements } } - // Selects one initial categore, inpractice randomly + // Selects one initial category, in practice randomly public void selectFirstCategory() { try { - final Object catId = categoryResources.keySet().iterator().next(); - final LinkedList res = (LinkedList) categoryResources.get(catId); - final Layout l = (Layout) categoryLayouts.get(catId); + final String catId = categoryResources.keySet().iterator().next(); + final LinkedList res = categoryResources.get(catId); + final Layout l = categoryLayouts.get(catId); final Button catB = (Button) l.getComponentIterator().next(); setSelectedResources(res); catB.setStyleName("selected-link"); @@ -89,12 +88,12 @@ public class ResourceSelectorPanel extends Panel implements } } - private void setSelectedResources(LinkedList resources) { + private void setSelectedResources(LinkedList resources) { selectedResources = resources; fireEvent(new SelectedResourcesChangedEvent()); } - public LinkedList getSelectedResources() { + public LinkedList getSelectedResources() { return selectedResources; } @@ -104,12 +103,12 @@ public class ResourceSelectorPanel extends Panel implements final Object data = ((Button) source).getData(); resetStyles(); if (data instanceof Item) { - final LinkedList rlist = new LinkedList(); - rlist.add(data); + final LinkedList rlist = new LinkedList(); + rlist.add((Item) data); setSelectedResources(rlist); } else { final String category = (String) data; - final LinkedList resources = (LinkedList) categoryResources + final LinkedList resources = categoryResources .get(category); setSelectedResources(resources); } @@ -119,10 +118,11 @@ public class ResourceSelectorPanel extends Panel implements } private void resetStyles() { - for (final Iterator it = categoryLayouts.values().iterator(); it + for (final Iterator it = categoryLayouts.values().iterator(); it .hasNext();) { - final Layout lo = (Layout) it.next(); - for (final Iterator bit = lo.getComponentIterator(); bit.hasNext();) { + final Layout lo = it.next(); + for (final Iterator bit = lo.getComponentIterator(); bit + .hasNext();) { final Button b = (Button) bit.next(); if (b.getData() instanceof Item) { b.setStyleName("link"); diff --git a/src/com/vaadin/demo/reservation/gwt/client/ReservationWidgetSet.java b/src/com/vaadin/demo/reservation/gwt/client/ReservationWidgetSet.java index 01577a6917..2520098aed 100644 --- a/src/com/vaadin/demo/reservation/gwt/client/ReservationWidgetSet.java +++ b/src/com/vaadin/demo/reservation/gwt/client/ReservationWidgetSet.java @@ -13,7 +13,7 @@ import com.vaadin.terminal.gwt.client.UIDL; public class ReservationWidgetSet extends DefaultWidgetSet { @Override public Paintable createWidget(UIDL uidl) { - final Class type = resolveWidgetType(uidl); + final Class type = resolveWidgetType(uidl); if (VGoogleMap.class == type) { return new VGoogleMap(); } else if (VCalendarField.class == type) { @@ -24,7 +24,7 @@ public class ReservationWidgetSet extends DefaultWidgetSet { } @Override - protected Class resolveWidgetType(UIDL uidl) { + protected Class resolveWidgetType(UIDL uidl) { final String tag = uidl.getTag(); if ("googlemap".equals(tag)) { return VGoogleMap.class; diff --git a/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java b/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java index e6150c39b7..48d7d4b7f2 100644 --- a/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java +++ b/src/com/vaadin/demo/reservation/gwt/client/ui/VGoogleMap.java @@ -35,11 +35,12 @@ public class VGoogleMap extends Composite implements Paintable { public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { widget.clearOverlays(); LatLng pos = null; - for (final Iterator it = uidl.getChildIterator(); it.hasNext();) { + for (final Iterator it = uidl.getChildIterator(); it.hasNext();) { final UIDL u = (UIDL) it.next(); if (u.getTag().equals("markers")) { - for (final Iterator m = u.getChildIterator(); m.hasNext();) { + for (final Iterator m = u.getChildIterator(); m + .hasNext();) { final UIDL umarker = (UIDL) m.next(); final String html = "" + umarker.getStringAttribute("html") + ""; diff --git a/src/com/vaadin/demo/reservation/simple/SimpleReserver.java b/src/com/vaadin/demo/reservation/simple/SimpleReserver.java index 9ad8a0e842..d2dd8bb45a 100644 --- a/src/com/vaadin/demo/reservation/simple/SimpleReserver.java +++ b/src/com/vaadin/demo/reservation/simple/SimpleReserver.java @@ -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"); } diff --git a/src/com/vaadin/demo/reservation/simple/StdView.java b/src/com/vaadin/demo/reservation/simple/StdView.java index 41d24a75f4..252e668ee5 100644 --- a/src/com/vaadin/demo/reservation/simple/StdView.java +++ b/src/com/vaadin/demo/reservation/simple/StdView.java @@ -88,7 +88,7 @@ public class StdView extends VerticalLayout { add.setEnabled(false); reservations.setEnabled(false); } else { - List resource = new LinkedList(); + List resource = new LinkedList(); resource.add(resources.getItem(resources.getValue())); final Container res = application.getDb().getReservations(resource); reservations.setContainerDataSource(res); diff --git a/src/com/vaadin/demo/sampler/ActiveLink.java b/src/com/vaadin/demo/sampler/ActiveLink.java index 375728aafc..9b6a47cb3b 100644 --- a/src/com/vaadin/demo/sampler/ActiveLink.java +++ b/src/com/vaadin/demo/sampler/ActiveLink.java @@ -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 listeners = new HashSet(); 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); diff --git a/src/com/vaadin/demo/sampler/FeatureView.java b/src/com/vaadin/demo/sampler/FeatureView.java index af7c00215e..f9a54328b2 100644 --- a/src/com/vaadin/demo/sampler/FeatureView.java +++ b/src/com/vaadin/demo/sampler/FeatureView.java @@ -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 c : features) { final Feature f = SamplerApplication.getFeatureFor(c); if (f != null) { String path = SamplerApplication.getPathFor(f); diff --git a/src/com/vaadin/demo/sampler/gwt/client/SamplerWidgetSet.java b/src/com/vaadin/demo/sampler/gwt/client/SamplerWidgetSet.java index 24dde94a3c..69942f6e50 100644 --- a/src/com/vaadin/demo/sampler/gwt/client/SamplerWidgetSet.java +++ b/src/com/vaadin/demo/sampler/gwt/client/SamplerWidgetSet.java @@ -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; -- 2.39.5