diff options
Diffstat (limited to 'src/com/itmill/toolkit/tests/featurebrowser/FeatureParameters.java')
-rw-r--r-- | src/com/itmill/toolkit/tests/featurebrowser/FeatureParameters.java | 62 |
1 files changed, 19 insertions, 43 deletions
diff --git a/src/com/itmill/toolkit/tests/featurebrowser/FeatureParameters.java b/src/com/itmill/toolkit/tests/featurebrowser/FeatureParameters.java index 30f9194d06..1107bb5148 100644 --- a/src/com/itmill/toolkit/tests/featurebrowser/FeatureParameters.java +++ b/src/com/itmill/toolkit/tests/featurebrowser/FeatureParameters.java @@ -1,30 +1,6 @@ -/* ************************************************************************* - - IT Mill Toolkit - - Development of Browser User Interfaces Made Easy - - Copyright (C) 2000-2006 IT Mill Ltd - - ************************************************************************* - - This product is distributed under commercial license that can be found - from the product package on license.pdf. Use of this product might - require purchasing a commercial license from IT Mill Ltd. For guidelines - on usage, see licensing-guidelines.html - - ************************************************************************* - - For more information, contact: - - IT Mill Ltd phone: +358 2 4802 7180 - Ruukinkatu 2-4 fax: +358 2 4802 7181 - 20540, Turku email: info@itmill.com - Finland company www: www.itmill.com - - Primary source for information and releases: www.itmill.com - - ********************************************************************** */ +/* +@ITMillApache2LicenseForJavaFiles@ + */ package com.itmill.toolkit.tests.featurebrowser; @@ -48,11 +24,11 @@ import com.itmill.toolkit.ui.Table; public class FeatureParameters extends Feature implements URIHandler, ParameterHandler { - private Label context = new Label(); + private final Label context = new Label(); - private Label relative = new Label(); + private final Label relative = new Label(); - private Table params = new Table(); + private final Table params = new Table(); public FeatureParameters() { super(); @@ -61,30 +37,30 @@ public class FeatureParameters extends Feature implements URIHandler, protected Component getDemoComponent() { - OrderedLayout l = new OrderedLayout(); + final OrderedLayout l = new OrderedLayout(); - Label info = new Label("To test this feature, try to " + final Label info = new Label("To test this feature, try to " + "add some get parameters to URL. For example if you have " + "the feature browser installed in your local host, try url: "); info.setCaption("Usage info"); l.addComponent(info); try { - URL u1 = new URL(getApplication().getURL(), + final URL u1 = new URL(getApplication().getURL(), "test/uri?test=1&test=2"); - URL u2 = new URL(getApplication().getURL(), + final URL u2 = new URL(getApplication().getURL(), "foo/bar?mary=john&count=3"); l.addComponent(new Link(u1.toString(), new ExternalResource(u1))); l.addComponent(new Label("Or this: ")); l.addComponent(new Link(u2.toString(), new ExternalResource(u2))); - } catch (Exception e) { + } catch (final Exception e) { System.out.println("Couldn't get hostname for this machine: " + e.toString()); e.printStackTrace(); } // URI - Panel p1 = new Panel("URI Handler"); + final Panel p1 = new Panel("URI Handler"); context.setCaption("Last URI handler context"); p1.addComponent(context); relative.setCaption("Last relative URI"); @@ -92,7 +68,7 @@ public class FeatureParameters extends Feature implements URIHandler, l.addComponent(p1); // Parameters - Panel p2 = new Panel("Parameter Handler"); + final Panel p2 = new Panel("Parameter Handler"); params.setCaption("Last parameters"); params.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID); params.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); @@ -101,9 +77,9 @@ public class FeatureParameters extends Feature implements URIHandler, // Properties propertyPanel = new PropertyPanel(p1); - Form ap = propertyPanel.createBeanPropertySet(new String[] { "width", - "height" }); - Select themes = (Select) propertyPanel.getField("style"); + final Form ap = propertyPanel.createBeanPropertySet(new String[] { + "width", "height" }); + final Select themes = (Select) propertyPanel.getField("style"); themes.addItem("light").getItemProperty( themes.getItemCaptionPropertyId()).setValue("light"); themes.addItem("strong").getItemProperty( @@ -169,9 +145,9 @@ public class FeatureParameters extends Feature implements URIHandler, */ public void handleParameters(Map parameters) { params.removeAllItems(); - for (Iterator i = parameters.keySet().iterator(); i.hasNext();) { - String name = (String) i.next(); - String[] values = (String[]) parameters.get(name); + for (final Iterator i = parameters.keySet().iterator(); i.hasNext();) { + final String name = (String) i.next(); + final String[] values = (String[]) parameters.get(name); String v = ""; for (int j = 0; j < values.length; j++) { if (v.length() > 0) { |