]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed usage of deprecated setWidth/setHeight (#5749)
authorArtur Signell <artur.signell@itmill.com>
Thu, 7 Oct 2010 10:23:31 +0000 (10:23 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 7 Oct 2010 10:23:31 +0000 (10:23 +0000)
Suppressed deprecation warnings where Date is used

svn changeset:15443/svn branch:6.5

46 files changed:
tests/src/com/vaadin/tests/BasicRandomTest.java
tests/src/com/vaadin/tests/LayoutDemo.java
tests/src/com/vaadin/tests/NativeWindowing.java
tests/src/com/vaadin/tests/RandomLayoutStress.java
tests/src/com/vaadin/tests/StressComponentsInTable.java
tests/src/com/vaadin/tests/TableChangingDatasource.java
tests/src/com/vaadin/tests/TestContainerChanges.java
tests/src/com/vaadin/tests/TestForBasicApplicationLayout.java
tests/src/com/vaadin/tests/TestForMultipleStyleNames.java
tests/src/com/vaadin/tests/TestForNativeWindowing.java
tests/src/com/vaadin/tests/TestForPreconfiguredComponents.java
tests/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
tests/src/com/vaadin/tests/TreeFilesystem.java
tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java
tests/src/com/vaadin/tests/components/accordion/RemoveTabs.java
tests/src/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java
tests/src/com/vaadin/tests/components/datefield/LenientMode.java
tests/src/com/vaadin/tests/components/datefield/TestDatefieldYear.java
tests/src/com/vaadin/tests/components/table/PropertyValueChange.java
tests/src/com/vaadin/tests/components/tabsheet/RemoveTabs.java
tests/src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java
tests/src/com/vaadin/tests/components/tree/ItemStyleGenerator.java
tests/src/com/vaadin/tests/dd/DDTest4.java
tests/src/com/vaadin/tests/dd/DDTest5.java
tests/src/com/vaadin/tests/dd/DDTest6.java
tests/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java
tests/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java
tests/src/com/vaadin/tests/featurebrowser/FeatureForm.java
tests/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java
tests/src/com/vaadin/tests/featurebrowser/IntroTerminal.java
tests/src/com/vaadin/tests/featurebrowser/PropertyPanel.java
tests/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java
tests/src/com/vaadin/tests/tickets/Ticket1245.java
tests/src/com/vaadin/tests/tickets/Ticket1804.java
tests/src/com/vaadin/tests/tickets/Ticket1868.java
tests/src/com/vaadin/tests/tickets/Ticket1869.java
tests/src/com/vaadin/tests/tickets/Ticket1904.java
tests/src/com/vaadin/tests/tickets/Ticket1939.java
tests/src/com/vaadin/tests/tickets/Ticket1940.java
tests/src/com/vaadin/tests/tickets/Ticket1966.java
tests/src/com/vaadin/tests/tickets/Ticket1966_2.java
tests/src/com/vaadin/tests/tickets/Ticket2001.java
tests/src/com/vaadin/tests/tickets/Ticket2009.java
tests/src/com/vaadin/tests/tickets/Ticket2021.java
tests/src/com/vaadin/tests/tickets/Ticket677.java
tests/src/com/vaadin/tests/util/RandomComponents.java

index 7a5de744310030b28ca1216ab3718a90b6d864ba..ad961a60c613be76c2f5e0b0e32310ed1667a2f9 100644 (file)
@@ -45,7 +45,6 @@ import com.vaadin.ui.Window;
  * @author IT Mill Ltd.
  * 
  */
-@SuppressWarnings("unchecked")
 public class BasicRandomTest extends com.vaadin.Application implements
         Button.ClickListener {
 
@@ -127,7 +126,7 @@ public class BasicRandomTest extends com.vaadin.Application implements
 
         final HorizontalLayout setupLayout = new HorizontalLayout();
         final Panel statusPanel = new Panel("Status");
-        statusPanel.setWidth(200);
+        statusPanel.setWidth("200px");
         setupLayout.addComponent(statusPanel);
         statusPanel.addComponent(statusLabel);
         setupLayout.addComponent(randomSeedValue);
index ce72d5ad17041613416a8bc7b1ac0bb76ec08545..a06e7e4da23f9879bcbef814a62442b37b1e9152 100644 (file)
@@ -112,7 +112,7 @@ public class LayoutDemo extends com.vaadin.Application {
         // loads image from package com.vaadin.demo
         final ClassResource cr = new ClassResource("m-bullet-blue.gif", this);
         final Embedded em = new Embedded("Embedded " + caption, cr);
-        em.setWidth(170);
+        em.setWidth("170px");
         return em;
     }
 
@@ -125,7 +125,7 @@ public class LayoutDemo extends com.vaadin.Application {
                         + " Panel contains an layout where the actual contained components are added, "
                         + "this layout may be switched on the fly.",
                 Label.CONTENT_XHTML));
-        panel.setWidth(222);
+        panel.setWidth("222px");
         return panel;
     }
 
index e1cf6087638908fdcb6f9114c7873b125ba3d931..877aeceae15cc4613e6590a1d52935b83a28595c 100644 (file)
@@ -30,11 +30,11 @@ public class NativeWindowing extends Application {
                         main.addWindow(w);
                         w.setPositionX(100);
                         w.setPositionY(100);
-                        w.setWidth(200);
-                        w.setHeight(200);
+                        w.setWidth("200px");
+                        w.setHeight("200px");
 
-                        w.setWidth(100);
-                        w.setHeight(400);
+                        w.setWidth("100px");
+                        w.setHeight("400px");
 
                         final Button closebutton = new Button("Close "
                                 + w.getCaption(), new Button.ClickListener() {
index 0e8ecb4564e60b7ca16157a4b85bd2da57a068af..7e4daa47dc80930a5bf580498639f5ff9a286bad 100644 (file)
@@ -153,7 +153,7 @@ public class RandomLayoutStress extends com.vaadin.Application {
                                     + "extremities and may have a caption to clarify the nature of the contained components' purpose."
                                     + " Panel contains an layout where the actual contained components are added, "
                                     + "this layout may be switched on the fly."));
-            ((Panel) result).setWidth(250);
+            ((Panel) result).setWidth("250px");
             break;
         case 6:
             // Datefield
index 921d3a65de0008b4bd5d05c81413e3c2d842e421..75b4916b37843386498ab4f2989231549a0a75a2 100644 (file)
@@ -40,7 +40,7 @@ public class StressComponentsInTable extends CustomComponent {
                 public void buttonClick(ClickEvent event) {\r
                     Button b = event.getButton();\r
                     System.out.println(b.getCaption() + " click: "\r
-                            + (new Date()).toGMTString());\r
+                            + (new Date()).toString());\r
                     System.out.println(b.getApplication());\r
 \r
                 }\r
index 66b38f9813f37616060d2689656f9412f47e7cf0..2b9639b32d6e4b3758e5300c4bb47b0956347b6a 100644 (file)
@@ -26,8 +26,8 @@ public class TableChangingDatasource extends CustomComponent implements
 \r
         t = new Table();\r
 \r
-        t.setWidth(500);\r
-        t.setHeight(300);\r
+        t.setWidth("500px");\r
+        t.setHeight("300px");\r
 \r
         ta[0] = TestForTablesInitialColumnWidthLogicRendering\r
                 .getTestTable(3, 0);\r
index 867768e71cc4693868d80992f19786939e435968..c3a1a986658d11fc7f552413b95abdf16862e7a9 100644 (file)
@@ -51,8 +51,8 @@ public class TestContainerChanges extends CustomComponent {
         VerticalLayout v = new VerticalLayout();\r
         h.addComponent(v);\r
         tbl = new Table();\r
-        tbl.setHeight(200);\r
-        tbl.setWidth(300);\r
+        tbl.setHeight("200px");\r
+        tbl.setWidth("300px");\r
         v.addComponent(tbl);\r
         tbl.setSelectable(true);\r
         tbl.setMultiSelect(false);\r
@@ -63,8 +63,8 @@ public class TestContainerChanges extends CustomComponent {
         tbl.setContainerDataSource(hierarchical);\r
 \r
         Table tbl2 = new Table();\r
-        tbl2.setHeight(200);\r
-        tbl2.setWidth(300);\r
+        tbl2.setHeight("200px");\r
+        tbl2.setWidth("300px");\r
         v.addComponent(tbl2);\r
         tbl2.setSelectable(true);\r
         tbl2.setMultiSelect(false);\r
index d5bf5a1483f6a906de1c411b23a2acf2df52d8c7..262b1275d93613b52c70f3fd6356c664a8320f45 100644 (file)
@@ -30,7 +30,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
         click = new Button("Set height -1", new ClickListener() {\r
 \r
             public void buttonClick(ClickEvent event) {\r
-                tab.setHeight(-1);\r
+                tab.setHeight(null);\r
             }\r
 \r
         });\r
index dbbaadeead5e0aa314794cb572b6c0cf7ab9f7df..7bad6299130e1b52a43f7f81daf028d44c78dc6c 100644 (file)
@@ -67,7 +67,7 @@ public class TestForMultipleStyleNames extends CustomComponent implements
 
     public void valueChange(ValueChangeEvent event) {
 
-        final String currentStyle = l.getStyle();
+        final String currentStyle = l.getStyleName();
         final String[] tmp = currentStyle.split(" ");
         final ArrayList<String> curStyles = new ArrayList<String>();
         for (int i = 0; i < tmp.length; i++) {
index 9728214163802914f8a46330427b37a55ef69438..38fbb42aa21ff63ff040ef06eff82c7aa6ef5608 100644 (file)
@@ -30,11 +30,11 @@ public class TestForNativeWindowing extends Application {
                         main.addWindow(w);
                         w.setPositionX(100);
                         w.setPositionY(100);
-                        w.setWidth(200);
-                        w.setHeight(200);
+                        w.setWidth("200px");
+                        w.setHeight("200px");
 
-                        w.setWidth(100);
-                        w.setHeight(400);
+                        w.setWidth("100px");
+                        w.setHeight("400px");
 
                         final Button closebutton = new Button("Close "
                                 + w.getCaption(), new Button.ClickListener() {
index f4ed33b28d76ae9db2148c6ac07eead6055de18b..e009489683ebeae404ffbf85adda24162f3a8839 100644 (file)
@@ -152,8 +152,8 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
         ol2.addComponent(commit);
         status.addComponent(ol2);
 
-        status.setHeight(300);
-        status.setWidth(400);
+        status.setHeight("300px");
+        status.setWidth("400px");
 
         ol.addComponent(status);
 
index 961a8cc5dc37749fe598a842f421b96f1b972de0..d849ab37a0fe32af6c18707df4c855fb919c861a 100644 (file)
@@ -79,7 +79,7 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
 
         t = getTestTable(3, 40);
         t.setCaption("Table with some columns and wide explicit width. (Ought to widen columns to use all space)");
-        t.setWidth(1000);
+        t.setWidth("1000px");
         main.addComponent(t);
 
         t = getTestTable(12, 4);
@@ -99,7 +99,7 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
         t = getTestTable(4, 4);
         t.setCaption("Table with some rows and width = 200px");
 
-        t.setWidth(200);
+        t.setWidth("200px");
         main.addComponent(t);
 
         final Button b = new Button("refresh view", this, "createNewView");
index c5ff1cb51d30cc0050dd25d0c9facad94eb4c796..d39c6008f6b07250944ec0d372bebce4915358d5 100644 (file)
@@ -42,7 +42,7 @@ public class TreeFilesystem extends com.vaadin.Application implements
         // configure file structure panel
         main.addComponent(explorerPanel);
         explorerPanel.addComponent(tree);
-        explorerPanel.setHeight(400);
+        explorerPanel.setHeight("400px");
 
         // "this" handles tree's expand event
         tree.addListener(this);
index 9a27d8afcded638a542f51a835dfb02e8087bbbd..2a2fc0153a3d20f30e908e55b9f515865c47f347 100644 (file)
@@ -17,6 +17,7 @@ public class AbstractFieldDataSourceReadOnly extends TestBase {
             return textField;\r
         }\r
 \r
+        @SuppressWarnings("unused")\r
         public void setTextField(ObjectProperty<String> textField) {\r
             this.textField = textField;\r
         }\r
index b346d0f666d834c3c49b4264c224534271f5104d..bc8bea1c567b9e315960cb28c178f680a57a99fe 100644 (file)
@@ -95,7 +95,6 @@ public class RemoveTabs extends TestBase {
         accordion.removeComponent(accordion.getComponentIterator().next());\r
     }\r
 \r
-    @SuppressWarnings("unchecked")\r
     private void closeLastTab() {\r
         Iterator<Component> i = accordion.getComponentIterator();\r
         Component last = null;\r
@@ -106,7 +105,6 @@ public class RemoveTabs extends TestBase {
         accordion.removeComponent(last);\r
     }\r
 \r
-    @SuppressWarnings("unchecked")\r
     private void reorder() {\r
         AbstractComponentContainer container = accordion;\r
 \r
index 140202bfac84ccbdcf4e9222479ac09623228ac3..b07a9b1ad82c20c247d784db89feb1e85ef7b777 100644 (file)
@@ -63,6 +63,7 @@ public class DateFieldEmptyValid extends TestBase {
         b = new Button("Set date to 4.5.1990");\r
         b.addListener(new ClickListener() {\r
 \r
+            @SuppressWarnings("deprecation")\r
             public void buttonClick(ClickEvent event) {\r
                 df.setValue(new Date(1990 - 1900, 5 - 1, 4));\r
             }\r
@@ -72,6 +73,7 @@ public class DateFieldEmptyValid extends TestBase {
         b = new Button("Set date to 5.6.2000 using a property data source");\r
         b.addListener(new ClickListener() {\r
 \r
+            @SuppressWarnings("deprecation")\r
             public void buttonClick(ClickEvent event) {\r
                 ObjectProperty<Date> dfProp = new ObjectProperty<Date>(\r
                         new Date(2000 - 1900, 6 - 1, 5), Date.class);\r
@@ -84,6 +86,7 @@ public class DateFieldEmptyValid extends TestBase {
                 "Set date to 27.8.2005 by changing a property data source from null");\r
         b.addListener(new ClickListener() {\r
 \r
+            @SuppressWarnings("deprecation")\r
             public void buttonClick(ClickEvent event) {\r
                 ObjectProperty<Date> dfProp = new ObjectProperty<Date>(null,\r
                         Date.class);\r
index 96eaa2117f2410f4ef5352a2919018b0d6301b58..cbe9ac613f9944bf7a07c6aacba6271eb81124bf 100644 (file)
@@ -26,6 +26,7 @@ public class LenientMode extends TestBase implements ValueChangeListener {
     @Override
     protected void setup() {
 
+        @SuppressWarnings("deprecation")
         Date d = new Date(2009 - 1900, 12 - 1, 31, 23, 59, 59);
 
         DateField df = new DateField("Lenient ");
index 8a1df36aa41865258a0ab5f5b2757fcc6659224c..4fa7a6811a307a9fc1b2f98656106d3c721c7b65 100644 (file)
@@ -20,6 +20,7 @@ public class TestDatefieldYear extends TestBase {
 
     @Override
     protected void setup() {
+        @SuppressWarnings("deprecation")
         DateField df = new DateField("Year", new Date(2009 - 1900, 4 - 1, 1));
         df.setLocale(new Locale("en", "US"));
         df.setResolution(DateField.RESOLUTION_YEAR);
index 4a676cc3b43bd83d05b85a39581bba36932951b2..59751379764749df49d4a9bb3ed46e173c6b39b8 100644 (file)
@@ -7,15 +7,15 @@ import com.vaadin.data.Property.ValueChangeListener;
 import com.vaadin.data.util.IndexedContainer;
 import com.vaadin.tests.components.TestBase;
 import com.vaadin.ui.AbstractSelect.NewItemHandler;
-import com.vaadin.ui.BaseFieldFactory;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.ComboBox;
 import com.vaadin.ui.Component;
+import com.vaadin.ui.DefaultFieldFactory;
 import com.vaadin.ui.Field;
-import com.vaadin.ui.FieldFactory;
 import com.vaadin.ui.Label;
 import com.vaadin.ui.Table;
 import com.vaadin.ui.Table.ColumnGenerator;
+import com.vaadin.ui.TableFieldFactory;
 
 public class PropertyValueChange extends TestBase {
 
@@ -65,7 +65,7 @@ public class PropertyValueChange extends TestBase {
         }
     };
 
-    FieldFactory ff = new MyFieldFactory();
+    TableFieldFactory ff = new MyFieldFactory();
 
     @Override
     public void setup() {
@@ -86,7 +86,7 @@ public class PropertyValueChange extends TestBase {
         t1.setPageLength(0);
         t1.setContainerDataSource(container);
         t1.addGeneratedColumn("integer x 3", multiplier);
-        t1.setFieldFactory(ff);
+        t1.setTableFieldFactory(ff);
         t1.setEditable(true);
         t1.setDebugId("editortable");
 
@@ -95,7 +95,7 @@ public class PropertyValueChange extends TestBase {
         t2.setDescription("This table is in editable mode."
                 + " Updates to common datasource should not affect redraw for this "
                 + "table. Only the components inside table should get updated.");
-        t2.setFieldFactory(ff);
+        t2.setTableFieldFactory(ff);
         t2.setEditable(true);
         t2.setEnabled(false);
         t2.setContainerDataSource(container);
@@ -119,7 +119,7 @@ public class PropertyValueChange extends TestBase {
     }
 }
 
-class MyFieldFactory extends BaseFieldFactory {
+class MyFieldFactory extends DefaultFieldFactory {
 
     IndexedContainer texts = new IndexedContainer();
 
index f0ae33c2a1e199d4584697651d91066276c7c00a..8602a9a3b4a8e1536e413ddb2b20ef5d032dea22 100644 (file)
@@ -114,7 +114,6 @@ public class RemoveTabs extends TestBase {
         tabsheet.removeComponent(tabsheet.getComponentIterator().next());\r
     }\r
 \r
-    @SuppressWarnings("unchecked")\r
     private void closeLastTab() {\r
         Iterator<Component> i = tabsheet.getComponentIterator();\r
         Component last = null;\r
@@ -125,7 +124,6 @@ public class RemoveTabs extends TestBase {
         tabsheet.removeComponent(last);\r
     }\r
 \r
-    @SuppressWarnings("unchecked")\r
     private void reorder() {\r
         AbstractComponentContainer container = tabsheet;\r
 \r
index 4a6dc0e06179dbe4a4b4b626f34d7e65655433c7..8449dd42bf70a770ce0c631c0c9fed53afc07b06 100644 (file)
@@ -43,8 +43,9 @@ public class TabSheetCaptions extends TestBase {
         Button button = new Button("Update tab caption");\r
         button.addListener(new Button.ClickListener() {\r
             public void buttonClick(ClickEvent event) {\r
-                tabSheet.setTabCaption(panel1, "This is a new tab caption "\r
-                        + dateFormatter.format(date));\r
+                tabSheet.getTab(panel1).setCaption(\r
+                        "This is a new tab caption "\r
+                                + dateFormatter.format(date));\r
             }\r
         });\r
 \r
index c4299ec93942c18ab6944296916fb40110f11b63..f2ca2a85bd1b93aa45c143170ff513392220e663 100644 (file)
@@ -1,8 +1,5 @@
 package com.vaadin.tests.components.tree;
 
-import java.io.IOException;
-import java.io.StringBufferInputStream;
-
 import com.vaadin.tests.components.TestBase;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.CustomLayout;
@@ -29,11 +26,7 @@ public class ItemStyleGenerator extends TestBase {
 
     @Override
     protected void setup() {
-        try {
-            styles = new CustomLayout(new StringBufferInputStream(css));
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
+        styles = new CustomLayout(css);
         addComponent(styles);
 
         Tree tree = new Tree();
index b382d4c03e06adce06c557022362419e86a19995..8685c6f5de31761e950ad1eb1c54b0daa5598d53 100644 (file)
@@ -11,7 +11,6 @@ import com.vaadin.event.dd.DragAndDropEvent;
 import com.vaadin.event.dd.DropHandler;
 import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
 import com.vaadin.event.dd.acceptcriteria.SourceIs;
-import com.vaadin.terminal.ThemeResource;
 import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
 import com.vaadin.tests.components.TestBase;
 import com.vaadin.tests.util.TestUtils;
@@ -149,11 +148,6 @@ public class DDTest4 extends TestBase {
 
     }
 
-    private final static ThemeResource FOLDER = new ThemeResource(
-            "../runo/icons/16/folder.png");
-    private final static ThemeResource DOC = new ThemeResource(
-            "../runo/icons/16/document.png");
-
     @Override
     protected String getDescription() {
         return "dd";
index e1884060b9adee311447f0f4b4aea47614cdf02f..e4f3d5335da8eb89341c3a90854efe421e677cd9 100644 (file)
@@ -7,7 +7,6 @@ import com.vaadin.event.dd.DropHandler;
 import com.vaadin.event.dd.DropTarget;
 import com.vaadin.event.dd.acceptcriteria.AcceptAll;
 import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
-import com.vaadin.terminal.ThemeResource;
 import com.vaadin.tests.components.TestBase;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.CssLayout;
@@ -165,11 +164,6 @@ public class DDTest5 extends TestBase {
 
     }
 
-    private final static ThemeResource FOLDER = new ThemeResource(
-            "../runo/icons/16/folder.png");
-    private final static ThemeResource DOC = new ThemeResource(
-            "../runo/icons/16/document.png");
-
     @Override
     protected String getDescription() {
         return "dd: DragAndDropWrapper to build various use cases completely on server side";
index b8540167c885da7e1be38f1ea401811e6d5f975d..014438a4e8f175b775230048f19c3d6a9dbdfcc4 100644 (file)
@@ -26,7 +26,6 @@ import com.vaadin.event.dd.acceptcriteria.AcceptAll;
 import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
 import com.vaadin.event.dd.acceptcriteria.Not;
 import com.vaadin.event.dd.acceptcriteria.SourceIsTarget;
-import com.vaadin.terminal.ApplicationResource;
 import com.vaadin.terminal.Resource;
 import com.vaadin.terminal.StreamResource;
 import com.vaadin.terminal.StreamResource.StreamSource;
@@ -66,8 +65,6 @@ public class DDTest6 extends TestBase {
 
     private BeanItemContainer<File> fs1;
 
-    private static int count;
-
     private static DDTest6 instance;
 
     @Override
@@ -267,13 +264,15 @@ public class DDTest6 extends TestBase {
     }
 
     private void showSpreadsheet(File file) {
-        ApplicationResource resource = (ApplicationResource) file.getResource();
+        // ApplicationResource resource = (ApplicationResource)
+        // file.getResource();
         String string = new String(file.bas.toByteArray());
         String[] rows = string.split("\n");
         String[] cols = rows[0].split(",");
         Table table = new Table();
         for (String string2 : cols) {
-            String col = string2.replaceAll("\"", ""); // remove surrounding ""
+            // String col =
+            string2.replaceAll("\"", ""); // remove surrounding ""
             table.addContainerProperty(string2, String.class, "");
         }
         for (int i = 1; i < rows.length; i++) {
index 92856aad41f7a915fe417074eec1ad1f04c69b55..2f1e111b99f4a31309c5e4c7366b155c131cfe87 100644 (file)
@@ -8,7 +8,6 @@ import java.util.Iterator;
 import java.util.StringTokenizer;
 
 import com.vaadin.data.Property;
-import com.vaadin.ui.AbstractComponent;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
 import com.vaadin.ui.Button.ClickListener;
@@ -50,7 +49,7 @@ public class FeatureBrowser extends CustomComponent implements
         features.setItemCaptionPropertyId("name");
         features.addListener(this);
         features.setImmediate(true);
-        features.setStyle("menu");
+        features.setStyleName("menu");
 
         // Configure component layout
         mainlayout = new CustomLayout("featurebrowser-mainlayout");
@@ -67,7 +66,7 @@ public class FeatureBrowser extends CustomComponent implements
 
         // Restart button
         final Button close = new Button("restart", getApplication(), "close");
-        close.setStyle("link");
+        close.setStyleName("link");
         mainlayout.addComponent(close, "restart");
 
         // Test component
@@ -163,15 +162,15 @@ public class FeatureBrowser extends CustomComponent implements
         // FIXME: navigation statistics
         try {
             if ((event.getProperty().toString() == null)
-                    && ((AbstractComponent) event.getProperty()).getTag()
-                            .equals("tree")) {
+                    && (event.getProperty() instanceof Tree)) {
                 // ignore tree initialization
             } else {
                 FeatureUtil.debug(
                         getApplication().getUser().toString(),
                         "valueChange "
-                                + ((AbstractComponent) event.getProperty())
-                                        .getTag() + ", " + event.getProperty());
+                                + event.getProperty().getClass()
+                                        .getSimpleName() + ", "
+                                + event.getProperty());
             }
         } catch (final Exception e) {
             // ignored, should never happen
@@ -213,8 +212,9 @@ public class FeatureBrowser extends CustomComponent implements
         // FIXME: navigation statistics
         try {
             FeatureUtil.debug(getApplication().getUser().toString(),
-                    "buttonClick " + event.getButton().getTag() + ", "
-                            + event.getButton().getCaption() + ", "
+                    "buttonClick "
+                            + event.getButton().getClass().getSimpleName()
+                            + ", " + event.getButton().getCaption() + ", "
                             + event.getButton().getValue());
         } catch (final Exception e) {
             // ignored, should never happen
index 8d44979b9126294c9298003027b52ce0171fa0dc..8edaecee6d868c8f199d7e51b0fbcc7d6049b9c2 100644 (file)
@@ -26,8 +26,8 @@ public class FeatureEmbedded extends Feature {
         final Embedded emb = new Embedded("Embedded Caption", flashResource);
         emb.setType(Embedded.TYPE_OBJECT);
         emb.setMimeType("application/x-shockwave-flash");
-        emb.setWidth(250);
-        emb.setHeight(100);
+        emb.setWidth("250px");
+        emb.setHeight("100px");
         l.addComponent(emb);
 
         // Properties
index a6aef3e1e940e16f84110c4e4ac4777cc9f1acc7..0bb0a02530629bf2c495455edbe3fefc68f2b21e 100644 (file)
@@ -117,13 +117,13 @@ public class FeatureForm extends Feature implements
                     final DateField d = new DateField("Time", new Date());
                     d.setDescription("This is a DateField-component with text-style");
                     d.setResolution(DateField.RESOLUTION_MIN);
-                    d.setStyle("text");
+                    d.setStyleName("text");
                     test.addField(new Object(), d);
                 }
                 if (value.equals("Calendar")) {
                     final DateField c = new DateField("Calendar", new Date());
                     c.setDescription("DateField-component with calendar-style and day-resolution");
-                    c.setStyle("calendar");
+                    c.setStyleName("calendar");
                     c.setResolution(DateField.RESOLUTION_DAY);
                     test.addField(new Object(), c);
                 }
@@ -134,7 +134,7 @@ public class FeatureForm extends Feature implements
                     s.addItem("Windows");
                     s.addItem("Solaris");
                     s.addItem("Symbian");
-                    s.setStyle("optiongroup");
+                    s.setStyleName("optiongroup");
 
                     test.addField(new Object(), s);
                 }
index a72dbd87734e01bd1cc6a1eff7ef551b4b2d7d30..4573b132487d812d7b2a71bc615571d472705cd5 100644 (file)
@@ -27,7 +27,7 @@ public class FeatureGridLayout extends Feature {
 
         final GridLayout gl = new GridLayout(3, 3);
         final DateField cal = new DateField("Test component 1", new Date());
-        cal.setStyle("calendar");
+        cal.setStyleName("calendar");
         gl.addComponent(cal, 1, 0, 2, 1);
         for (int i = 2; i < 7; i++) {
             gl.addComponent(new TextField("Test component " + i));
index 4d6ee6987457d4e4e23d44cfe7c22bf1d49e3b45..177f8bcb53bf5c2ddc0608928d5bfbb7026a142c 100644 (file)
@@ -20,7 +20,7 @@ public class IntroTerminal extends Feature {
         final VerticalLayout l = new VerticalLayout();
 
         final Label lab = new Label();
-        lab.setStyle("featurebrowser-none");
+        lab.setStyleName("featurebrowser-none");
         l.addComponent(lab);
 
         // Properties
index f68aa152ce9d949774915fed0587fa8120e8747a..32cef16e222fe6e04321f97bf56623c915bbaa46 100644 (file)
@@ -19,7 +19,6 @@ import com.vaadin.terminal.ErrorMessage;
 import com.vaadin.terminal.SystemError;
 import com.vaadin.terminal.ThemeResource;
 import com.vaadin.terminal.UserError;
-import com.vaadin.ui.AbstractComponent;
 import com.vaadin.ui.AbstractComponentContainer;
 import com.vaadin.ui.AbstractField;
 import com.vaadin.ui.Button;
@@ -344,11 +343,10 @@ public class PropertyPanel extends Panel implements Button.ClickListener,
 
         // FIXME: navigation statistics
         try {
-            FeatureUtil.debug(
-                    getApplication().getUser().toString(),
+            FeatureUtil.debug(getApplication().getUser().toString(),
                     "valueChange "
-                            + ((AbstractComponent) event.getProperty())
-                                    .getTag() + ", " + event.getProperty());
+                            + event.getProperty().getClass().getSimpleName()
+                            + ", " + event.getProperty());
         } catch (final Exception e) {
             // ignored, should never happen
         }
@@ -421,8 +419,9 @@ public class PropertyPanel extends Panel implements Button.ClickListener,
         // FIXME: navigation statistics
         try {
             FeatureUtil.debug(getApplication().getUser().toString(),
-                    "buttonClick " + event.getButton().getTag() + ", "
-                            + event.getButton().getCaption() + ", "
+                    "buttonClick "
+                            + event.getButton().getClass().getSimpleName()
+                            + ", " + event.getButton().getCaption() + ", "
                             + event.getButton().getValue());
         } catch (final Exception e) {
             // ignored, should never happen
index 25df5307ee1d191c217b6eec904835fd7b0f9bca..2888972d253a88e8d0f30b3eea786aa79425a597 100644 (file)
@@ -16,12 +16,11 @@ import com.vaadin.tests.components.TestBase;
 import com.vaadin.ui.AbsoluteLayout;\r
 import com.vaadin.ui.AbsoluteLayout.ComponentPosition;\r
 import com.vaadin.ui.AbstractComponent;\r
-import com.vaadin.ui.BaseFieldFactory;\r
 import com.vaadin.ui.Button;\r
 import com.vaadin.ui.Button.ClickEvent;\r
 import com.vaadin.ui.Component;\r
+import com.vaadin.ui.DefaultFieldFactory;\r
 import com.vaadin.ui.Field;\r
-import com.vaadin.ui.FieldFactory;\r
 import com.vaadin.ui.Form;\r
 import com.vaadin.ui.Label;\r
 import com.vaadin.ui.Layout;\r
@@ -31,7 +30,7 @@ import com.vaadin.ui.Window;
 \r
 public class TestAbsoluteLayout extends TestBase {\r
 \r
-    private static class MFieldFactory extends BaseFieldFactory {\r
+    private static class MFieldFactory extends DefaultFieldFactory {\r
 \r
         @Override\r
         public Field createField(Item item, Object propertyId,\r
@@ -61,7 +60,7 @@ public class TestAbsoluteLayout extends TestBase {
 \r
         private static MFieldFactory instance;\r
 \r
-        public static FieldFactory get() {\r
+        public static DefaultFieldFactory get() {\r
             if (instance == null) {\r
                 instance = new MFieldFactory();\r
             }\r
@@ -269,13 +268,13 @@ public class TestAbsoluteLayout extends TestBase {
             componentEditor = new Form();\r
             componentEditor.setWriteThrough(false);\r
             componentEditor.setCaption("Component properties:");\r
-            componentEditor.setFieldFactory(MFieldFactory.get());\r
+            componentEditor.setFormFieldFactory(MFieldFactory.get());\r
             addComponent(componentEditor);\r
 \r
             positionEditor = new Form();\r
             positionEditor.setCaption("Component position");\r
             positionEditor.setWriteThrough(false);\r
-            positionEditor.setFieldFactory(MFieldFactory.get());\r
+            positionEditor.setFormFieldFactory(MFieldFactory.get());\r
             addComponent(positionEditor);\r
 \r
             Button b = new Button("Commit changes", new Button.ClickListener() {\r
index c8936a18918bf46330bebb70876843798f4ed307..e83ac6aded755b01f340d5fc3491669fc7ccf4f6 100644 (file)
@@ -40,7 +40,7 @@ class TreeExample extends CustomComponent {
 \r
         // Panel w/ Tree\r
         main.setStyleName(Reindeer.PANEL_LIGHT);\r
-        main.setWidth(200);\r
+        main.setWidth("200px");\r
         // // Description, this is needed. Works in first slot\r
         main.addComponent(new Label(desc));\r
 \r
index 8d8740895de4542b956852f5e7570eb5c5f2e0bf..f1c37ac7857c48870573d9272bf902d97a7063ff 100644 (file)
@@ -107,7 +107,7 @@ public class Ticket1804 extends com.vaadin.Application {
                 Window w = new Window("Status of the fields");\r
                 w.setModal(true);\r
                 w.setScrollable(true);\r
-                w.setHeight(80);\r
+                w.setHeight("80px");\r
                 w.setHeightUnits(Sizeable.UNITS_PERCENTAGE);\r
                 w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML));\r
                 main.addWindow(w);\r
index 3b68146df34ec8482cea28e087a047f5d73eb5e3..edf9c1207d285f564e36777130cb704decba3640 100644 (file)
@@ -12,8 +12,8 @@ public class Ticket1868 extends com.vaadin.Application {
 \r
         Panel p = new Panel(\r
                 "This is a really long caption for the panel, too long in fact!");\r
-        p.setWidth(300);\r
-        p.setHeight(300);\r
+        p.setWidth("300px");\r
+        p.setHeight("300px");\r
 \r
         getMainWindow().addComponent(p);\r
     }\r
index 22afdcbc2d274fb04154598186a92d741f599c8f..953217f9071c54f2c47768d1b2f16b429cb5e2e5 100644 (file)
@@ -20,7 +20,7 @@ public class Ticket1869 extends com.vaadin.Application {
         VerticalLayout el = new VerticalLayout();\r
         Panel elp = new Panel(\r
                 "Vertical ExpandLayout /w first component expanded", el);\r
-        el.setHeight(1000);\r
+        el.setHeight("1000px");\r
         for (int i = 0; i < 3; i++) {\r
             Button b = new Button("x");\r
             el.addComponent(b);\r
@@ -30,14 +30,14 @@ public class Ticket1869 extends com.vaadin.Application {
             }\r
         }\r
         lo.addComponent(elp);\r
-        elp.setWidth(300);\r
-        elp.setHeight(300);\r
+        elp.setWidth("300px");\r
+        elp.setHeight("300px");\r
         elp.setScrollable(true);\r
 \r
         HorizontalLayout elh = new HorizontalLayout();\r
         Panel elph = new Panel(\r
                 "Horizontal ExpandLayout /w first component expanded", elh);\r
-        elh.setWidth(1000);\r
+        elh.setWidth("1000px");\r
         for (int i = 0; i < 3; i++) {\r
             Button b = new Button("x");\r
             elh.addComponent(b);\r
@@ -47,8 +47,8 @@ public class Ticket1869 extends com.vaadin.Application {
             }\r
         }\r
         lo.addComponent(elph);\r
-        elph.setWidth(300);\r
-        elph.setHeight(300);\r
+        elph.setWidth("300px");\r
+        elph.setHeight("300px");\r
         elph.setScrollable(true);\r
 \r
     }\r
index 8240e7e9f4344a178cee228852d5a53f48c78ce4..1d7915833356e24c98e155f6d3186318b6361c78 100644 (file)
@@ -36,7 +36,7 @@ public class Ticket1904 extends Application {
         for (int i = 0; i < 3; i++) {
             Button b = new Button("Row " + (i + 1));
             if (!horizontal) {
-                b.setWidth(500);
+                b.setWidth("500px");
             }
             ol.addComponent(b);
         }
index 7cc2cf8abf7a03f4fba2d6410212a7a42f7f86f7..2970335d836e6bb3c7a4774fe57daa159b37ea99 100644 (file)
@@ -15,8 +15,8 @@ public class Ticket1939 extends Application {
         setMainWindow(w);
 
         final VerticalLayout l = new VerticalLayout();
-        l.setWidth(400);
-        l.setHeight(100);
+        l.setWidth("400px");
+        l.setHeight("100px");
         l.addComponent(new TextField("This one works fine"));
         TextField t = new TextField();
         t.setRequired(true);
@@ -27,7 +27,7 @@ public class Ticket1939 extends Application {
         w.addComponent(new Button("show me the bug",
                 new Button.ClickListener() {
                     public void buttonClick(ClickEvent event) {
-                        l.setWidth(-1);
+                        l.setWidth(null);
                     }
                 }));
 
index 14419fd5078fd7dcb740a38797dcd0946a6a15ac..a3264ecba40f76ea0339b26334939f2cad523e69 100644 (file)
@@ -13,8 +13,8 @@ public class Ticket1940 extends Application {
         setMainWindow(w);
 
         final VerticalLayout l = new VerticalLayout();
-        l.setWidth(200);
-        l.setHeight(-1);
+        l.setWidth("200px");
+        l.setHeight(null);
         TextField t = new TextField();
         l.addComponent(t);
         t.setRequired(true);
index 49128760332d15a82fdba491a85084dd529d39f9..5f1f152f3f961137e8d0613d1ea71eaad20ce237 100644 (file)
@@ -53,7 +53,7 @@ public class Ticket1966 extends Application {
         addButtons(gl);\r
 \r
         b = new Button("High button");\r
-        b.setHeight(200);\r
+        b.setHeight("200px");\r
         gl.addComponent(b);\r
 \r
         p.addComponent(gl);\r
index 5b2b7a9dd1f57e51bb408e1d3a39e398c786698b..65fe2cc2ff93048fc1acbe93adbeb5819f34926e 100644 (file)
@@ -50,8 +50,8 @@ public class Ticket1966_2 extends Application {
 \r
     private void gridLayout(Layout layout) {\r
         Panel p = new Panel("GridLayout");\r
-        p.setWidth(500);\r
-        p.setHeight(500);\r
+        p.setWidth("500px");\r
+        p.setHeight("500px");\r
         p.getContent().setSizeFull();\r
         layout.addComponent(p);\r
 \r
@@ -86,8 +86,8 @@ public class Ticket1966_2 extends Application {
 \r
     private void orderedLayout(Layout layout) {\r
         Panel p = new Panel("OrderedLayout");\r
-        p.setWidth(500);\r
-        p.setHeight(500);\r
+        p.setWidth("500px");\r
+        p.setHeight("500px");\r
         p.getContent().setWidth("100%");\r
         layout.addComponent(p);\r
 \r
@@ -101,7 +101,7 @@ public class Ticket1966_2 extends Application {
 \r
         ol = new HorizontalLayout();\r
         // ol.setCaption("Vertical");\r
-        ol.setHeight(200);\r
+        ol.setHeight("200px");\r
         addButtons(ol);\r
         // Button b = new Button("High button");\r
         // b.setHeight(200);\r
index 5469b115348e177d29dcab07ff8536c243a7e33a..64dd47c2e295a55dcfcf666f8a04b7b0181ed073 100644 (file)
@@ -23,7 +23,11 @@ public class Ticket2001 extends Application {
         final Button b = new Button("fixed width: 30px", false);
         b.addListener(new Property.ValueChangeListener() {
             public void valueChange(ValueChangeEvent event) {
-                l.setWidth(b.booleanValue() ? 30 : -1);
+                if (b.booleanValue()) {
+                    l.setWidth("30px");
+                } else {
+                    l.setWidth(null);
+                }
             }
         });
         b.setImmediate(true);
index f1d55bbb13be891e1ab77fb151fbe74552b81e6e..f726ff10deec603c77a21b809add48143040630a 100644 (file)
@@ -105,8 +105,8 @@ public class Ticket2009 extends com.vaadin.Application {
             addComponent(editor);\r
             addComponent(done);\r
 \r
-            setWidth(W);\r
-            setHeight(H);\r
+            setWidth(W + "px");\r
+            setHeight(H + "px");\r
 \r
             setPositionX(event.getClientX() - W / 2);\r
             setPositionY(event.getClientY() - H / 2);\r
index 7cc1e49f69c09ea744da0624e6f7a03ac1297848..736723bdf1f681a5255332e2ad773c22a3f9ae7e 100644 (file)
@@ -74,8 +74,8 @@ public class Ticket2021 extends Application {
 \r
         Panel p3 = new Panel();\r
         p3.setCaption("GridLayout");\r
-        p3.setWidth(500);\r
-        p3.setHeight(500);\r
+        p3.setWidth("500px");\r
+        p3.setHeight("500px");\r
         // p3.setContent(new GridLayout());\r
         p3.getContent().setSizeFull();\r
         ((Layout) p3.getContent()).setMargin(false);\r
index a5c8e1314c9249c44d56b37d181b40ebbb71e5b0..d288168d7c4ee1cc39dfc311daea486084db3567 100644 (file)
@@ -10,6 +10,7 @@ import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;\r
 import com.vaadin.ui.Component;\r
 import com.vaadin.ui.ComponentContainer;\r
+import com.vaadin.ui.DefaultFieldFactory;\r
 import com.vaadin.ui.Field;\r
 import com.vaadin.ui.Form;\r
 import com.vaadin.ui.GridLayout;\r
@@ -131,7 +132,7 @@ public class Ticket677 extends Application {
             p.setValue(i % 5 == 0 ? "enabled" : "disabled");\r
         }\r
 \r
-        table.setFieldFactory(new BaseFieldFactory() {\r
+        table.setTableFieldFactory(new DefaultFieldFactory() {\r
 \r
             @Override\r
             public Field createField(Container container, Object itemId,\r
index 215f1c146015ffed708dc170623b134b9e94f481..c47c3787d632403f44399ad43c523498c2f213f0 100644 (file)
@@ -175,7 +175,7 @@ public class RandomComponents {
                                     + "extremities and may have a caption to clarify the nature of the contained components' purpose."
                                     + " Panel contains an layout where the actual contained components are added, "
                                     + "this layout may be switched on the fly."));
-            ((Panel) result).setWidth(250);
+            ((Panel) result).setWidth("250px");
             break;
         case 6:
             // Datefield