From 9d2fc03d1569f32952f85f0b15e0e0c46c774dc4 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 7 Oct 2010 06:34:58 +0000 Subject: [PATCH] Removed use of deprecated OrderedLayout (#5749) svn changeset:15431/svn branch:6.5 --- .../tests/TestComponentAddAndRecursion.java | 13 +- .../com/vaadin/tests/TestForAlignments.java | 18 +- .../tests/TestForContainerFilterable.java | 4 +- .../tests/TestForPreconfiguredComponents.java | 2 +- tests/src/com/vaadin/tests/TestForTrees.java | 4 +- .../TestSelectAndDatefieldInDeepLayouts.java | 9 +- .../vaadin/tests/featurebrowser/Feature.java | 6 +- .../featurebrowser/FeatureOrderedLayout.java | 14 +- .../featurebrowser/FeatureTextField.java | 24 +-- .../tests/featurebrowser/PropertyPanel.java | 169 ++++-------------- .../OrderedLayoutCSSCompatibility.java | 5 +- .../com/vaadin/tests/tickets/Ticket1435.java | 4 +- .../com/vaadin/tests/tickets/Ticket1572.java | 4 +- .../com/vaadin/tests/tickets/Ticket1805.java | 3 +- .../com/vaadin/tests/tickets/Ticket1878.java | 32 ++-- .../com/vaadin/tests/tickets/Ticket1916.java | 4 +- .../com/vaadin/tests/tickets/Ticket1966.java | 40 ++--- .../vaadin/tests/tickets/Ticket1966_2.java | 34 +--- .../vaadin/tests/tickets/Ticket1966_3.java | 10 +- .../com/vaadin/tests/tickets/Ticket2021.java | 5 +- .../com/vaadin/tests/tickets/Ticket2029.java | 8 +- .../com/vaadin/tests/tickets/Ticket2061b.java | 4 +- .../com/vaadin/tests/tickets/Ticket2151.java | 6 +- .../com/vaadin/tests/tickets/Ticket2157.java | 6 +- .../com/vaadin/tests/tickets/Ticket2178.java | 6 +- .../com/vaadin/tests/tickets/Ticket2204.java | 8 +- .../com/vaadin/tests/tickets/Ticket2221.java | 6 +- .../com/vaadin/tests/tickets/Ticket2222.java | 6 +- .../Ticket2227OrderedlayoutInTable.java | 4 +- .../com/vaadin/tests/tickets/Ticket2231.java | 6 +- .../com/vaadin/tests/tickets/Ticket2234.java | 6 +- .../com/vaadin/tests/tickets/Ticket2235.java | 6 +- .../com/vaadin/tests/tickets/Ticket2240.java | 6 +- .../com/vaadin/tests/tickets/Ticket2242.java | 6 +- .../com/vaadin/tests/tickets/Ticket2271.java | 6 +- .../com/vaadin/tests/tickets/Ticket2294.java | 6 +- .../vaadin/tests/util/RandomComponents.java | 63 +++---- 37 files changed, 198 insertions(+), 365 deletions(-) diff --git a/tests/src/com/vaadin/tests/TestComponentAddAndRecursion.java b/tests/src/com/vaadin/tests/TestComponentAddAndRecursion.java index 473c0b5674..711003010e 100644 --- a/tests/src/com/vaadin/tests/TestComponentAddAndRecursion.java +++ b/tests/src/com/vaadin/tests/TestComponentAddAndRecursion.java @@ -8,7 +8,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -44,9 +43,9 @@ public class TestComponentAddAndRecursion extends CustomComponent { Button b = new Button("use gridlayout", new Button.ClickListener() { public void buttonClick(ClickEvent event) { - p.setLayout(new GridLayout()); - p2.setLayout(new GridLayout()); - p3.setLayout(new GridLayout()); + p.setContent(new GridLayout()); + p2.setContent(new GridLayout()); + p3.setContent(new GridLayout()); } }); @@ -54,9 +53,9 @@ public class TestComponentAddAndRecursion extends CustomComponent { b = new Button("use orderedlayout", new Button.ClickListener() { public void buttonClick(ClickEvent event) { - p.setLayout(new OrderedLayout()); - p2.setLayout(new OrderedLayout()); - p3.setLayout(new OrderedLayout()); + p.setContent(new VerticalLayout()); + p2.setContent(new VerticalLayout()); + p3.setContent(new VerticalLayout()); } }); diff --git a/tests/src/com/vaadin/tests/TestForAlignments.java b/tests/src/com/vaadin/tests/TestForAlignments.java index 8315169cb9..4296744224 100644 --- a/tests/src/com/vaadin/tests/TestForAlignments.java +++ b/tests/src/com/vaadin/tests/TestForAlignments.java @@ -4,11 +4,11 @@ package com.vaadin.tests; +import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.DateField; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -33,20 +33,20 @@ public class TestForAlignments extends CustomComponent { vert.addComponent(t1); vert.addComponent(d1); // vert.getSize().setWidth(500); - vert.setComponentAlignment(b1, OrderedLayout.ALIGNMENT_RIGHT, OrderedLayout.ALIGNMENT_TOP); - vert.setComponentAlignment(b2, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_TOP); - vert.setComponentAlignment(t1, OrderedLayout.ALIGNMENT_RIGHT, OrderedLayout.ALIGNMENT_TOP); - vert.setComponentAlignment(d1, OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER, OrderedLayout.ALIGNMENT_TOP); + vert.setComponentAlignment(b1, Alignment.TOP_RIGHT); + vert.setComponentAlignment(b2, Alignment.TOP_LEFT); + vert.setComponentAlignment(t1, Alignment.TOP_RIGHT); + vert.setComponentAlignment(d1, Alignment.TOP_CENTER); final HorizontalLayout hori = new HorizontalLayout(); hori.addComponent(b3); hori.addComponent(b4); hori.addComponent(t2); hori.addComponent(d2); // hori.getSize().setHeight(200); - hori.setComponentAlignment(b3, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_BOTTOM); - hori.setComponentAlignment(b4, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_TOP); - hori.setComponentAlignment(t2, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_BOTTOM); - hori.setComponentAlignment(d2, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_VERTICAL_CENTER); + hori.setComponentAlignment(b3, Alignment.BOTTOM_LEFT); + hori.setComponentAlignment(b4, Alignment.TOP_LEFT); + hori.setComponentAlignment(t2, Alignment.BOTTOM_LEFT); + hori.setComponentAlignment(d2, Alignment.MIDDLE_LEFT); main.addComponent(vert); main.addComponent(hori); diff --git a/tests/src/com/vaadin/tests/TestForContainerFilterable.java b/tests/src/com/vaadin/tests/TestForContainerFilterable.java index f521ba63bf..3abd57c5a0 100644 --- a/tests/src/com/vaadin/tests/TestForContainerFilterable.java +++ b/tests/src/com/vaadin/tests/TestForContainerFilterable.java @@ -8,8 +8,8 @@ import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.Table; import com.vaadin.ui.TextField; @@ -39,7 +39,7 @@ public class TestForContainerFilterable extends CustomComponent { } // Init filtering view - final Panel filterPanel = new Panel("Filter", new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL)); + final Panel filterPanel = new Panel("Filter", new HorizontalLayout()); filterPanel.setWidth(100, Panel.UNITS_PERCENTAGE); lo.addComponent(filterPanel); filterPanel.addComponent(fooFilter); diff --git a/tests/src/com/vaadin/tests/TestForPreconfiguredComponents.java b/tests/src/com/vaadin/tests/TestForPreconfiguredComponents.java index edc2ca3105..0a2589770c 100644 --- a/tests/src/com/vaadin/tests/TestForPreconfiguredComponents.java +++ b/tests/src/com/vaadin/tests/TestForPreconfiguredComponents.java @@ -121,7 +121,7 @@ public class TestForPreconfiguredComponents extends CustomComponent implements H public Panel createTestBench(Component t) { final Panel ol = new Panel(); - ol.setLayout(new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL)); + ol.setLayout(new HorizontalLayout()); ol.addComponent(t); diff --git a/tests/src/com/vaadin/tests/TestForTrees.java b/tests/src/com/vaadin/tests/TestForTrees.java index f1ec2eba12..76341cb314 100644 --- a/tests/src/com/vaadin/tests/TestForTrees.java +++ b/tests/src/com/vaadin/tests/TestForTrees.java @@ -6,6 +6,7 @@ package com.vaadin.tests; import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -13,7 +14,6 @@ import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; @@ -75,7 +75,7 @@ public class TestForTrees extends CustomComponent implements Handler { t.setCaption("with actions"); t.setImmediate(true); t.addActionHandler(this); - final OrderedLayout ol = (OrderedLayout) createTestBench(t); + final AbstractOrderedLayout ol = (AbstractOrderedLayout) createTestBench(t); al = new Panel("action log"); ol.addComponent(al); main.addComponent(ol); diff --git a/tests/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java b/tests/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java index da4cd1edb3..5a72a34be9 100644 --- a/tests/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java +++ b/tests/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java @@ -7,11 +7,10 @@ package com.vaadin.tests; import java.util.Collection; import java.util.Vector; -import com.vaadin.ui.AbstractLayout; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.DateField; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.Select; import com.vaadin.ui.VerticalLayout; @@ -28,7 +27,7 @@ import com.vaadin.ui.VerticalLayout; public class TestSelectAndDatefieldInDeepLayouts extends CustomComponent { public TestSelectAndDatefieldInDeepLayouts() { - final OrderedLayout root = (OrderedLayout) getOrderedLayout(); + final AbstractOrderedLayout root = getOrderedLayout(); setCompositionRoot(root); root.addComponent(getSelect()); @@ -44,7 +43,7 @@ public class TestSelectAndDatefieldInDeepLayouts extends CustomComponent { p1.addComponent(getSelect()); p1.addComponent(getDateField()); - final OrderedLayout l1 = (OrderedLayout) getOrderedLayout(); + final AbstractOrderedLayout l1 = getOrderedLayout(); p1.addComponent(l1); l1.addComponent(getSelect()); @@ -62,7 +61,7 @@ public class TestSelectAndDatefieldInDeepLayouts extends CustomComponent { } - AbstractLayout getOrderedLayout() { + VerticalLayout getOrderedLayout() { final VerticalLayout l = new VerticalLayout(); l.setCaption(getCaption("orderedlayout")); return l; diff --git a/tests/src/com/vaadin/tests/featurebrowser/Feature.java b/tests/src/com/vaadin/tests/featurebrowser/Feature.java index df7293d374..842a89c446 100644 --- a/tests/src/com/vaadin/tests/featurebrowser/Feature.java +++ b/tests/src/com/vaadin/tests/featurebrowser/Feature.java @@ -9,8 +9,8 @@ import com.vaadin.terminal.Resource; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Embedded; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; @@ -80,8 +80,8 @@ public abstract class Feature extends CustomComponent { // Description tab final String title = getTitle(); if (getDescriptionXHTML() != null) { - final OrderedLayout mainLayout = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL); - final OrderedLayout layout = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); + final VerticalLayout mainLayout = new VerticalLayout(); + final HorizontalLayout layout = new HorizontalLayout(); mainLayout.addComponent(layout); if (getImage() != null) { layout.addComponent(new Embedded("", new ClassResource(getImage(), getApplication()))); diff --git a/tests/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java index 95c2b405c3..dfee2df618 100644 --- a/tests/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java @@ -5,8 +5,6 @@ package com.vaadin.tests.featurebrowser; import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Select; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -30,11 +28,15 @@ public class FeatureOrderedLayout extends Feature { // Properties propertyPanel = new PropertyPanel(ol); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { "orientation" }); - ap.replaceWithSelect("orientation", new Object[] { new Integer(OrderedLayout.ORIENTATION_HORIZONTAL), new Integer(OrderedLayout.ORIENTATION_VERTICAL) }, new Object[] { "Horizontal", "Vertical" }); + // final Form ap = propertyPanel.createBeanPropertySet(new String[] { + // "orientation" }); + // ap.replaceWithSelect("orientation", new Object[] { new + // Integer(AbstractOrderedLayout.ORIENTATION_HORIZONTAL), new + // Integer(AbstractOrderedLayout.ORIENTATION_VERTICAL) }, new Object[] { + // "Horizontal", "Vertical" }); final Select themes = (Select) propertyPanel.getField("style"); themes.addItem("form").getItemProperty(themes.getItemCaptionPropertyId()).setValue("form"); - propertyPanel.addProperties("OrderedLayout Properties", ap); + // propertyPanel.addProperties("OrderedLayout Properties", ap); setJavadocURL("ui/OrderedLayout.html"); @@ -43,7 +45,7 @@ public class FeatureOrderedLayout extends Feature { @Override protected String getExampleSrc() { - return "OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_FLOW);\n" + "ol.addComponent(new TextField(\"Textfield caption\"));\n" + "ol.addComponent(new Label(\"Label\"));\n"; + return "OrderedLayout ol = new OrderedLayout(AbstractOrderedLayout.ORIENTATION_FLOW);\n" + "ol.addComponent(new TextField(\"Textfield caption\"));\n" + "ol.addComponent(new Label(\"Label\"));\n"; } diff --git a/tests/src/com/vaadin/tests/featurebrowser/FeatureTextField.java b/tests/src/com/vaadin/tests/featurebrowser/FeatureTextField.java index f2612ec857..00db4c5708 100644 --- a/tests/src/com/vaadin/tests/featurebrowser/FeatureTextField.java +++ b/tests/src/com/vaadin/tests/featurebrowser/FeatureTextField.java @@ -6,7 +6,7 @@ package com.vaadin.tests.featurebrowser; import com.vaadin.ui.Component; import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.TextField; public class FeatureTextField extends Feature { @@ -18,18 +18,14 @@ public class FeatureTextField extends Feature { @Override protected Component getDemoComponent() { - final OrderedLayout l = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - + final HorizontalLayout l = new HorizontalLayout(); // Test component final TextField tf = new TextField("Caption"); l.addComponent(tf); // Properties propertyPanel = new PropertyPanel(tf); - final Form f = propertyPanel.createBeanPropertySet(new String[] { - "columns", "rows", "wordwrap", "writeThrough", "readThrough", - "nullRepresentation", "nullSettingAllowed", "secret" }); + final Form f = propertyPanel.createBeanPropertySet(new String[] { "columns", "rows", "wordwrap", "writeThrough", "readThrough", "nullRepresentation", "nullSettingAllowed", "secret" }); propertyPanel.addProperties("Text field properties", f); setJavadocURL("ui/TextField.html"); @@ -39,8 +35,7 @@ public class FeatureTextField extends Feature { @Override protected String getExampleSrc() { - return "TextField tf = new TextField(\"Caption\");\n" - + "tf.setValue(\"Contents\");"; + return "TextField tf = new TextField(\"Caption\");\n" + "tf.setValue(\"Contents\");"; } /** @@ -48,16 +43,7 @@ public class FeatureTextField extends Feature { */ @Override protected String getDescriptionXHTML() { - return "TextField combines the logic of both the single line text-entry field and the multi-line " - + "text-area into one component. " - + "As with all Data-components of Vaadin, the TextField can also be bound to an " - + "underlying data source, both directly or in a buffered (asynchronous) " - + "mode. In buffered mode its background color will change to indicate " - + "that the value has changed but is not committed." - + "

Furthermore a validators may be bound to the component to " - + "check and validate the given input before it is actually committed." - + "

On the demo tab you can try out how the different properties affect the " - + "presentation of the component."; + return "TextField combines the logic of both the single line text-entry field and the multi-line " + "text-area into one component. " + "As with all Data-components of Vaadin, the TextField can also be bound to an " + "underlying data source, both directly or in a buffered (asynchronous) " + "mode. In buffered mode its background color will change to indicate " + "that the value has changed but is not committed." + "

Furthermore a validators may be bound to the component to " + "check and validate the given input before it is actually committed." + "

On the demo tab you can try out how the different properties affect the " + "presentation of the component."; } @Override diff --git a/tests/src/com/vaadin/tests/featurebrowser/PropertyPanel.java b/tests/src/com/vaadin/tests/featurebrowser/PropertyPanel.java index 8ec16b12f0..cc70330d52 100644 --- a/tests/src/com/vaadin/tests/featurebrowser/PropertyPanel.java +++ b/tests/src/com/vaadin/tests/featurebrowser/PropertyPanel.java @@ -27,8 +27,8 @@ import com.vaadin.ui.Component; import com.vaadin.ui.DateField; import com.vaadin.ui.Field; import com.vaadin.ui.Form; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.Select; import com.vaadin.ui.Table; @@ -37,8 +37,7 @@ import com.vaadin.ui.Tree; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; -public class PropertyPanel extends Panel implements Button.ClickListener, - Property.ValueChangeListener { +public class PropertyPanel extends Panel implements Button.ClickListener, Property.ValueChangeListener { private Select addComponent; @@ -74,8 +73,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, config = new BeanItem(objectToConfigure); // Control buttons - final OrderedLayout buttons = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); + final HorizontalLayout buttons = new HorizontalLayout(); buttons.setMargin(false, true, true, true); buttons.addComponent(setButton); buttons.addComponent(discardButton); @@ -86,8 +84,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, if (objectToConfigure instanceof Select) { addSelectProperties(); } - if (objectToConfigure instanceof AbstractField - && !(objectToConfigure instanceof Table || objectToConfigure instanceof Tree)) { + if (objectToConfigure instanceof AbstractField && !(objectToConfigure instanceof Table || objectToConfigure instanceof Tree)) { addFieldProperties(); } if ((objectToConfigure instanceof AbstractComponentContainer)) { @@ -99,8 +96,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, allProperties.addContainerProperty("Type", String.class, ""); allProperties.addContainerProperty("R/W", String.class, ""); allProperties.addContainerProperty("Demo", String.class, ""); - allProperties.setColumnAlignments(new String[] { Table.ALIGN_LEFT, - Table.ALIGN_LEFT, Table.ALIGN_CENTER, Table.ALIGN_CENTER }); + allProperties.setColumnAlignments(new String[] { Table.ALIGN_LEFT, Table.ALIGN_LEFT, Table.ALIGN_CENTER, Table.ALIGN_CENTER }); allProperties.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID); allProperties.setPageLength(0); allProperties.setSizeFull(); @@ -151,12 +147,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, // Fill the table for (int i = 0; i < pd.length; i++) { - allProperties.addItem( - new Object[] { pd[i].getName(), - pd[i].getPropertyType().getName(), - (pd[i].getWriteMethod() == null ? "R" : "R/W"), - (listed.contains(pd[i].getName()) ? "x" : "") }, - pd[i]); + allProperties.addItem(new Object[] { pd[i].getName(), pd[i].getPropertyType().getName(), (pd[i].getWriteMethod() == null ? "R" : "R/W"), (listed.contains(pd[i].getName()) ? "x" : "") }, pd[i]); } } @@ -164,14 +155,10 @@ public class PropertyPanel extends Panel implements Button.ClickListener, private void addBasicComponentProperties() { // Set of properties - final Form set = createBeanPropertySet(new String[] { "caption", - "icon", "componentError", "description", "enabled", "visible", - "style", "readOnly", "immediate" }); + final Form set = createBeanPropertySet(new String[] { "caption", "icon", "componentError", "description", "enabled", "visible", "style", "readOnly", "immediate" }); // Icon - set.replaceWithSelect("icon", new Object[] { null, - new ThemeResource("icon/files/file.gif") }, new Object[] { - "No icon", "Sample icon" }); + set.replaceWithSelect("icon", new Object[] { null, new ThemeResource("icon/files/file.gif") }, new Object[] { "No icon", "Sample icon" }); // Component error Throwable sampleException; @@ -180,85 +167,26 @@ public class PropertyPanel extends Panel implements Button.ClickListener, } catch (final NullPointerException e) { sampleException = e; } - set.replaceWithSelect( - "componentError", - new Object[] { - null, - new UserError("Sample text error message."), - new UserError( - "

Error message formatting

Error messages can " - + "contain any UIDL formatting, like:

", - UserError.CONTENT_UIDL, - ErrorMessage.INFORMATION), - new SystemError( - "This is an example of exception error reposting", - sampleException) }, new Object[] { "No error", - "Sample text error", "Sample Formatted error", - "Sample System Error" }); + set.replaceWithSelect("componentError", new Object[] { null, new UserError("Sample text error message."), new UserError("

Error message formatting

Error messages can " + "contain any UIDL formatting, like:

", UserError.CONTENT_UIDL, ErrorMessage.INFORMATION), new SystemError("This is an example of exception error reposting", sampleException) }, new Object[] { "No error", "Sample text error", "Sample Formatted error", "Sample System Error" }); // Style - final String currentStyle = ((Component) objectToConfigure) - .getStyleName(); + final String currentStyle = ((Component) objectToConfigure).getStyleName(); if (currentStyle == null) { - set.replaceWithSelect("style", new Object[] { null }, - new Object[] { "Default" }).setNewItemsAllowed(true); + set.replaceWithSelect("style", new Object[] { null }, new Object[] { "Default" }).setNewItemsAllowed(true); } else { - set.replaceWithSelect("style", new Object[] { null, currentStyle }, - new Object[] { "Default", currentStyle }) - .setNewItemsAllowed(true); + set.replaceWithSelect("style", new Object[] { null, currentStyle }, new Object[] { "Default", currentStyle }).setNewItemsAllowed(true); } // Set up descriptions - set.getField("caption") - .setDescription( - "Component caption is the title of the component. Usage of the caption is optional and the " - + "exact behavior of the propery is defined by the component. Setting caption null " - + "or empty disables the caption."); - set.getField("enabled") - .setDescription( - "Enabled property controls the usage of the component. If the component is disabled (enabled=false)," - + " it can not receive any events from the terminal. In most cases it makes the usage" - + " of the component easier, if the component visually looks disbled (for example is grayed), " - + "when it can not be used."); - set.getField("icon") - .setDescription( - "Icon of the component selects the main icon of the component. The usage of the icon is identical " - + "to caption and in most components caption and icon are kept together. Icons can be " - + "loaded from any resources (see Terminal/Resources for more information). Some components " - + "contain more than just the captions icon. Those icons are controlled through their " - + "own properties."); - set.getField("visible") - .setDescription( - "Visibility property says if the component is renreded or not. Invisible components are implicitly " - + "disabled, as there is no visible user interface to send event."); - set.getField("description") - .setDescription( - "Description is designed to allow easy addition of short tooltips, like this. Like the caption," - + " setting description null or empty disables the description."); - set.getField("readOnly") - .setDescription( - "Those components that have internal state that can be written are settable to readOnly-mode," - + " where the object can only be read, not written."); - set.getField("componentError") - .setDescription( - "Vaadin supports extensive error reporting. One part of the error reporting are component" - + " errors that can be controlled by the programmer. This example only contains couple of " - + "sample errors; to get the full picture, read browse ErrorMessage-interface implementors " - + "API documentation."); - set.getField("immediate") - .setDescription( - "Not all terminals can send the events immediately to server from all action. Web is the most " - + "typical environment where many events (like textfield changed) are not sent to server, " - + "before they are explicitly submitted. Setting immediate property true (by default this " - + "is false for most components), the programmer can assure that the application is" - + " notified as soon as possible about the value change in this component."); - set.getField("style") - .setDescription( - "Themes specify the overall looks of the user interface. In addition component can have a set of " - + "styles, that can be visually very different (like datefield calendar- and text-styles), " - + "but contain the same logical functionality. As a rule of thumb, theme specifies if a " - + "component is blue or yellow and style determines how the component is used."); + set.getField("caption").setDescription("Component caption is the title of the component. Usage of the caption is optional and the " + "exact behavior of the propery is defined by the component. Setting caption null " + "or empty disables the caption."); + set.getField("enabled").setDescription("Enabled property controls the usage of the component. If the component is disabled (enabled=false)," + " it can not receive any events from the terminal. In most cases it makes the usage" + " of the component easier, if the component visually looks disbled (for example is grayed), " + "when it can not be used."); + set.getField("icon").setDescription("Icon of the component selects the main icon of the component. The usage of the icon is identical " + "to caption and in most components caption and icon are kept together. Icons can be " + "loaded from any resources (see Terminal/Resources for more information). Some components " + "contain more than just the captions icon. Those icons are controlled through their " + "own properties."); + set.getField("visible").setDescription("Visibility property says if the component is renreded or not. Invisible components are implicitly " + "disabled, as there is no visible user interface to send event."); + set.getField("description").setDescription("Description is designed to allow easy addition of short tooltips, like this. Like the caption," + " setting description null or empty disables the description."); + set.getField("readOnly").setDescription("Those components that have internal state that can be written are settable to readOnly-mode," + " where the object can only be read, not written."); + set.getField("componentError").setDescription("Vaadin supports extensive error reporting. One part of the error reporting are component" + " errors that can be controlled by the programmer. This example only contains couple of " + "sample errors; to get the full picture, read browse ErrorMessage-interface implementors " + "API documentation."); + set.getField("immediate").setDescription("Not all terminals can send the events immediately to server from all action. Web is the most " + "typical environment where many events (like textfield changed) are not sent to server, " + "before they are explicitly submitted. Setting immediate property true (by default this " + "is false for most components), the programmer can assure that the application is" + " notified as soon as possible about the value change in this component."); + set.getField("style").setDescription("Themes specify the overall looks of the user interface. In addition component can have a set of " + "styles, that can be visually very different (like datefield calendar- and text-styles), " + "but contain the same logical functionality. As a rule of thumb, theme specifies if a " + "component is blue or yellow and style determines how the component is used."); // Add created fields to property panel addProperties("Component Basics", set); @@ -274,17 +202,11 @@ public class PropertyPanel extends Panel implements Button.ClickListener, /** Add properties for selecting */ private void addSelectProperties() { - final Form set = createBeanPropertySet(new String[] { - "newItemsAllowed", "lazyLoading", "multiSelect" }); + final Form set = createBeanPropertySet(new String[] { "newItemsAllowed", "lazyLoading", "multiSelect" }); addProperties("Select Properties", set); - set.getField("multiSelect").setDescription( - "Specified if multiple items can be selected at once."); - set.getField("newItemsAllowed") - .setDescription( - "Select component (but not Tree or Table) can allow the user to directly " - + "add new items to set of options. The new items are constrained to be " - + "strings and thus feature only applies to simple lists."); + set.getField("multiSelect").setDescription("Specified if multiple items can be selected at once."); + set.getField("newItemsAllowed").setDescription("Select component (but not Tree or Table) can allow the user to directly " + "add new items to set of options. The new items are constrained to be " + "strings and thus feature only applies to simple lists."); /* * Button ll = (Button) set.getField("lazyLoading"); ll * .setDescription("In Ajax rendering mode select supports lazy loading @@ -294,8 +216,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, * set.getField("multiSelect").setVisible(false); * set.getField("newItemsAllowed").setVisible(false); } */ - if (objectToConfigure instanceof Tree - || objectToConfigure instanceof Table) { + if (objectToConfigure instanceof Tree || objectToConfigure instanceof Table) { set.removeItemProperty("newItemsAllowed"); set.removeItemProperty("lazyLoading"); } @@ -307,9 +228,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, final Form set = createBeanPropertySet(new String[] { "required" }); set.addField("focus", new Button("Focus", objectToConfigure, "focus")); - set.getField("focus").setDescription( - "Focus the cursor to this field. Not all " - + "components and/or terminals support this feature."); + set.getField("focus").setDescription("Focus the cursor to this field. Not all " + "components and/or terminals support this feature."); addProperties("Field Features", set); @@ -320,8 +239,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, * container */ private void addComponentContainerProperties() { - final Form set = new Form(new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL)); + final Form set = new Form(new VerticalLayout()); addComponent = new Select(); addComponent.setImmediate(true); @@ -332,9 +250,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, addComponent.addListener(this); set.addField("component adder", addComponent); - set.addField("remove all components", new Button( - "Remove all components", objectToConfigure, - "removeAllComponents")); + set.addField("remove all components", new Button("Remove all components", objectToConfigure, "removeAllComponents")); addProperties("ComponentContainer Features", set); } @@ -344,11 +260,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, // FIXME: navigation statistics try { - FeatureUtil.debug( - getApplication().getUser().toString(), - "valueChange " - + ((AbstractComponent) event.getProperty()) - .getTag() + ", " + event.getProperty()); + FeatureUtil.debug(getApplication().getUser().toString(), "valueChange " + ((AbstractComponent) event.getProperty()).getTag() + ", " + event.getProperty()); } catch (final Exception e) { // ignored, should never happen } @@ -360,8 +272,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, if (value != null) { // TextField component if (value.equals("Text field")) { - ((AbstractComponentContainer) objectToConfigure) - .addComponent(new TextField("Test field")); + ((AbstractComponentContainer) objectToConfigure).addComponent(new TextField("Test field")); } // DateField time style @@ -370,8 +281,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, d.setDescription("This is a DateField-component with text-style"); d.setResolution(DateField.RESOLUTION_MIN); d.setStyleName("text"); - ((AbstractComponentContainer) objectToConfigure) - .addComponent(d); + ((AbstractComponentContainer) objectToConfigure).addComponent(d); } // Date field calendar style @@ -380,8 +290,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, c.setDescription("DateField-component with calendar-style and day-resolution"); c.setStyleName("calendar"); c.setResolution(DateField.RESOLUTION_DAY); - ((AbstractComponentContainer) objectToConfigure) - .addComponent(c); + ((AbstractComponentContainer) objectToConfigure).addComponent(c); } // Select option group style @@ -393,15 +302,13 @@ public class PropertyPanel extends Panel implements Button.ClickListener, s.addItem("Solaris"); s.addItem("Symbian"); - ((AbstractComponentContainer) objectToConfigure) - .addComponent(s); + ((AbstractComponentContainer) objectToConfigure).addComponent(s); } addComponent.setValue(null); } } else if (event.getProperty() == getField("lazyLoading")) { - final boolean newValue = ((Boolean) event.getProperty().getValue()) - .booleanValue(); + final boolean newValue = ((Boolean) event.getProperty().getValue()).booleanValue(); final Field multiselect = getField("multiSelect"); final Field newitems = getField("newItemsAllowed"); if (newValue) { @@ -420,10 +327,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, public void buttonClick(Button.ClickEvent event) { // FIXME: navigation statistics try { - FeatureUtil.debug(getApplication().getUser().toString(), - "buttonClick " + event.getButton().getTag() + ", " - + event.getButton().getCaption() + ", " - + event.getButton().getValue()); + FeatureUtil.debug(getApplication().getUser().toString(), "buttonClick " + event.getButton().getTag() + ", " + event.getButton().getCaption() + ", " + event.getButton().getValue()); } catch (final Exception e) { // ignored, should never happen } @@ -446,8 +350,7 @@ public class PropertyPanel extends Panel implements Button.ClickListener, */ protected Form createBeanPropertySet(String names[]) { - final Form set = new Form(new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL)); + final Form set = new Form(new VerticalLayout()); for (int i = 0; i < names.length; i++) { final Property p = config.getItemProperty(names[i]); diff --git a/tests/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java b/tests/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java index 6073edf249..41f1de2c4a 100644 --- a/tests/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java +++ b/tests/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java @@ -1,7 +1,7 @@ package com.vaadin.tests.layouts; import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.OrderedLayout; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.TextField; public class OrderedLayoutCSSCompatibility extends TestBase { @@ -18,8 +18,7 @@ public class OrderedLayoutCSSCompatibility extends TestBase { @Override protected void setup() { - OrderedLayout l = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); + HorizontalLayout l = new HorizontalLayout(); l.setMargin(true); l.setSpacing(true); l.addComponent(new TextField("abc")); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1435.java b/tests/src/com/vaadin/tests/tickets/Ticket1435.java index fea1000ffe..8ca9292fcb 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1435.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1435.java @@ -1,6 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; @@ -9,7 +10,6 @@ import com.vaadin.ui.CustomComponent; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; @@ -24,7 +24,7 @@ public class Ticket1435 extends Application { final Window mainWin = new Window("ButtonPanel containing a table test"); setMainWindow(mainWin); - ((OrderedLayout) mainWin.getLayout()).setSpacing(true); + ((AbstractOrderedLayout) mainWin.getLayout()).setSpacing(true); ButtonPanel dataCardView1 = buildButtonPanel("My Tickets"); ButtonPanel dataCardView2 = buildButtonPanel("My Tickets 2"); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1572.java b/tests/src/com/vaadin/tests/tickets/Ticket1572.java index 39fb91b6eb..7905328f8e 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1572.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1572.java @@ -3,8 +3,8 @@ package com.vaadin.tests.tickets; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.GridLayout; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.Window; @@ -22,7 +22,7 @@ public class Ticket1572 extends com.vaadin.Application { Panel p = new Panel("Test wrapper for gridlayout margin/spacing"); - p.setLayout(new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL)); + p.setLayout(new HorizontalLayout()); gl = new GridLayout(3, 3); gl.setMargin(true); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1805.java b/tests/src/com/vaadin/tests/tickets/Ticket1805.java index f8906daaa7..b324321e8e 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1805.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1805.java @@ -2,6 +2,7 @@ package com.vaadin.tests.tickets; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; @@ -43,7 +44,7 @@ public class Ticket1805 extends com.vaadin.Application { grid.addComponent(new Label("VEEEEEEEEEEERY_WIDE")); Label label = new Label("|"); grid.addComponent(label); - grid.setComponentAlignment(label, GridLayout.ALIGNMENT_RIGHT, GridLayout.ALIGNMENT_TOP); + grid.setComponentAlignment(label, Alignment.TOP_RIGHT); main.addComponent(grid); } diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1878.java b/tests/src/com/vaadin/tests/tickets/Ticket1878.java index f06d3c2706..ecc076ee15 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1878.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1878.java @@ -10,6 +10,7 @@ import com.vaadin.data.validator.StringLengthValidator; import com.vaadin.terminal.Resource; import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.UserError; +import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -21,7 +22,6 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -87,15 +87,15 @@ public class Ticket1878 extends Application { GridLayout layout = new GridLayout(1, 5); GridLayout l1 = new GridLayout(1, 3); - createLayout(l1, new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL), "1000px", "150px", "100%", null, true); - createLayout(l1, new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL), "1000px", "150px", "50px", null, false); + createLayout(l1, new HorizontalLayout(), "1000px", "150px", "100%", null, true); + createLayout(l1, new HorizontalLayout(), "1000px", "150px", "50px", null, false); GridLayout l2 = new GridLayout(6, 1); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), "200px", "500px", true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), "200px", "500px", "100%", null, true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), "150px", "500px", true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), "150px", "500px", "100%", null, true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), "100px", "500px", true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), "100px", "500px", "100%", null, true); + createLayout(l2, new VerticalLayout(), "200px", "500px", true); + createLayout(l2, new VerticalLayout(), "200px", "500px", "100%", null, true); + createLayout(l2, new VerticalLayout(), "150px", "500px", true); + createLayout(l2, new VerticalLayout(), "150px", "500px", "100%", null, true); + createLayout(l2, new VerticalLayout(), "100px", "500px", true); + createLayout(l2, new VerticalLayout(), "100px", "500px", "100%", null, true); layout.addComponent(l1); layout.addComponent(l2); @@ -243,19 +243,19 @@ public class Ticket1878 extends Application { } private static void createLayout(GridLayout parentLayout, Layout newLayout, String w, String h, String componentWidth, String componentHeight, boolean align) { - int dir; + String dirText = "V"; String type; if (newLayout instanceof VerticalLayout) { - dir = OrderedLayout.ORIENTATION_VERTICAL; type = "OL"; - } else if (newLayout instanceof OrderedLayout) { - dir = OrderedLayout.ORIENTATION_HORIZONTAL; + } else if (newLayout instanceof HorizontalLayout) { + dirText = "H"; type = "OL"; } else { - dir = ((GridLayout) newLayout).getColumns() == 1 ? OrderedLayout.ORIENTATION_VERTICAL : OrderedLayout.ORIENTATION_HORIZONTAL; + if (((GridLayout) newLayout).getColumns() != 1) { + dirText = "H"; + } type = "GL"; } - String dirText = (dir == OrderedLayout.ORIENTATION_HORIZONTAL ? "H" : "V"); String alignText = align ? "-A" : ""; String cWidth = componentWidth == null ? "" : " - " + componentWidth; Panel p = new Panel(type + "/" + dirText + alignText + " " + w + "x" + h + cWidth, newLayout); @@ -288,7 +288,7 @@ public class Ticket1878 extends Application { p.addComponent(tf); if (align) { - ((AlignmentHandler) newLayout).setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, OrderedLayout.ALIGNMENT_BOTTOM); + ((AlignmentHandler) newLayout).setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); } } } diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1916.java b/tests/src/com/vaadin/tests/tickets/Ticket1916.java index 578aa103f4..d340bf144a 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1916.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1916.java @@ -2,8 +2,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.terminal.UserError; +import com.vaadin.ui.Alignment; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; @@ -19,7 +19,7 @@ public class Ticket1916 extends Application { tf.setComponentError(new UserError("Error message")); test.addComponent(tf); - test.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER, OrderedLayout.ALIGNMENT_VERTICAL_CENTER); + test.setComponentAlignment(tf, Alignment.MIDDLE_CENTER); Window w = new Window("Test #1916", test); setMainWindow(w); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1966.java b/tests/src/com/vaadin/tests/tickets/Ticket1966.java index bde7e848a8..5cc83b1033 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1966.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1966.java @@ -1,47 +1,27 @@ package com.vaadin.tests.tickets; -import java.util.HashMap; -import java.util.Map; - import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; +import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; public class Ticket1966 extends Application { - private static final int LEFT = OrderedLayout.ALIGNMENT_LEFT; - private static final int CENTER = OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER; - private static final int RIGHT = OrderedLayout.ALIGNMENT_RIGHT; - private static final int TOP = OrderedLayout.ALIGNMENT_TOP; - private static final int VCENTER = OrderedLayout.ALIGNMENT_VERTICAL_CENTER; - private static final int BOTTOM = OrderedLayout.ALIGNMENT_BOTTOM; - - private static Map names = new HashMap(); - static { - names.put(new Integer(LEFT), "Left"); - names.put(new Integer(CENTER), "Center"); - names.put(new Integer(RIGHT), "Right"); - names.put(new Integer(BOTTOM), "Bottom"); - names.put(new Integer(VCENTER), "Vcenter"); - names.put(new Integer(TOP), "Top"); - } - @Override public void init() { Window w = new Window(getClass().getName()); setMainWindow(w); // setTheme("tests-tickets"); - w.setLayout(new GridLayout(2, 2)); + w.setContent(new GridLayout(2, 2)); // w.getLayout().setSizeFull(); - createUI(w.getLayout()); + createUI((Layout) w.getContent()); } private void createUI(Layout layout) { @@ -104,7 +84,7 @@ public class Ticket1966 extends Application { addButtons(ol); b = new Button("High button"); - b.setHeight(200); + b.setHeight("200px"); ol.addComponent(b); p.addComponent(ol); @@ -112,16 +92,16 @@ public class Ticket1966 extends Application { } private void addButtons(Layout ol) { - ol.addComponent(getButton(ol, LEFT, TOP)); - ol.addComponent(getButton(ol, CENTER, VCENTER)); - ol.addComponent(getButton(ol, RIGHT, BOTTOM)); + ol.addComponent(getButton(ol, Alignment.TOP_LEFT)); + ol.addComponent(getButton(ol, Alignment.MIDDLE_CENTER)); + ol.addComponent(getButton(ol, Alignment.BOTTOM_RIGHT)); } - private Button getButton(Layout l, int hAlign, int vAlign) { - Button b = new Button("Narrow Button - " + names.get(new Integer(hAlign)) + " - " + names.get(new Integer(vAlign))); + private Button getButton(Layout l, Alignment align) { + Button b = new Button("Narrow Button - " + align.getHorizontalAlignment() + " - " + align.getVerticalAlignment()); b.setWidth("100px"); - ((AlignmentHandler) l).setComponentAlignment(b, hAlign, vAlign); + ((AlignmentHandler) l).setComponentAlignment(b, align); return b; diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1966_2.java b/tests/src/com/vaadin/tests/tickets/Ticket1966_2.java index af869a4071..ce9e936fc0 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1966_2.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1966_2.java @@ -1,39 +1,19 @@ package com.vaadin.tests.tickets; -import java.util.HashMap; -import java.util.Map; - import com.vaadin.Application; import com.vaadin.ui.AbstractOrderedLayout; +import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Layout; import com.vaadin.ui.Layout.AlignmentHandler; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; public class Ticket1966_2 extends Application { - private static final int LEFT = OrderedLayout.ALIGNMENT_LEFT; - private static final int CENTER = OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER; - private static final int RIGHT = OrderedLayout.ALIGNMENT_RIGHT; - private static final int TOP = OrderedLayout.ALIGNMENT_TOP; - private static final int VCENTER = OrderedLayout.ALIGNMENT_VERTICAL_CENTER; - private static final int BOTTOM = OrderedLayout.ALIGNMENT_BOTTOM; - - private static Map names = new HashMap(); - static { - names.put(new Integer(LEFT), "Left"); - names.put(new Integer(CENTER), "Center"); - names.put(new Integer(RIGHT), "Right"); - names.put(new Integer(BOTTOM), "Bottom"); - names.put(new Integer(VCENTER), "Vcenter"); - names.put(new Integer(TOP), "Top"); - } - @Override public void init() { Window w = new Window(getClass().getName()); @@ -170,16 +150,16 @@ public class Ticket1966_2 extends Application { } private void addButtons(Layout ol) { - ol.addComponent(getButton(ol, LEFT, TOP)); - ol.addComponent(getButton(ol, CENTER, VCENTER)); - ol.addComponent(getButton(ol, RIGHT, BOTTOM)); + ol.addComponent(getButton(ol, Alignment.TOP_LEFT)); + ol.addComponent(getButton(ol, Alignment.MIDDLE_CENTER)); + ol.addComponent(getButton(ol, Alignment.BOTTOM_RIGHT)); } - private Button getButton(Layout l, int hAlign, int vAlign) { - Button b = new Button(names.get(new Integer(hAlign)) + " - " + names.get(new Integer(vAlign))); + private Button getButton(Layout l, Alignment align) { + Button b = new Button(align.getHorizontalAlignment() + " - " + align.getVerticalAlignment()); // b.setWidth("100"); - ((AlignmentHandler) l).setComponentAlignment(b, hAlign, vAlign); + ((AlignmentHandler) l).setComponentAlignment(b, align); return b; diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1966_3.java b/tests/src/com/vaadin/tests/tickets/Ticket1966_3.java index c4bc05b1cb..4a4b336eb9 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket1966_3.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket1966_3.java @@ -3,8 +3,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.UserError; +import com.vaadin.ui.Alignment; import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -33,14 +33,14 @@ public class Ticket1966_3 extends Application { tf.setWidth("100px"); ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, OrderedLayout.ALIGNMENT_TOP); + ol.setComponentAlignment(tf, Alignment.TOP_RIGHT); tf = new TextField("Short caption"); tf.setWidth("100px"); tf.setComponentError(new UserError("error message")); ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, OrderedLayout.ALIGNMENT_TOP); + ol.setComponentAlignment(tf, Alignment.TOP_RIGHT); tf = new TextField("Short caption"); tf.setComponentError(new UserError("error message")); @@ -49,14 +49,14 @@ public class Ticket1966_3 extends Application { tf.setComponentError(new UserError("error message")); ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, OrderedLayout.ALIGNMENT_TOP); + ol.setComponentAlignment(tf, Alignment.TOP_RIGHT); tf = new TextField(); tf.setValue("No caption"); tf.setWidth("100px"); ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, OrderedLayout.ALIGNMENT_TOP); + ol.setComponentAlignment(tf, Alignment.TOP_RIGHT); layout.addComponent(p); } diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2021.java b/tests/src/com/vaadin/tests/tickets/Ticket2021.java index e761f7e858..dd3912e2d0 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2021.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2021.java @@ -9,7 +9,6 @@ import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -21,7 +20,7 @@ public class Ticket2021 extends Application { private String contents = "This TextField SHOULD FILL the panel and NOT CAUSE any scrollbars to appear in the Panel. Scrollbars SHOULD appear in the TextField AND the whole scrollbars (includinc arrow down) SHOULD be visible.\n\n" + "" + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent quis justo. Vivamus nec mi eu libero convallis auctor. Mauris et arcu. Nunc luctus justo. Aenean convallis, odio in vehicula scelerisque, est magna condimentum pede, a aliquam elit eros vitae diam. Phasellus porttitor convallis tellus. Nullam elementum, ligula nec viverra malesuada, risus tortor bibendum dui, eget hendrerit sem enim at massa. Nam eu pede sed nulla congue fermentum. Vestibulum malesuada libero non nunc. Proin rutrum. Fusce erat pede, volutpat vitae, aliquam ut, sagittis vel, augue. Fusce dui pede, convallis nec, accumsan tincidunt, consectetuer ac, purus. Nulla facilisi. Ut nisi. Sed orci risus, lacinia eu, sodales molestie, gravida quis, neque. Vestibulum pharetra ornare elit. Nulla porttitor molestie mauris. Morbi fringilla tellus sed risus. Curabitur varius massa." + "Nulla nisi. Sed blandit, ante vitae sagittis volutpat, arcu mauris vehicula risus, vitae posuere felis lectus sit amet purus. Donec nec magna et leo eleifend scelerisque. Suspendisse condimentum pharetra ligula. Curabitur lorem. Pellentesque a augue sit amet enim fermentum placerat. Phasellus ante risus, molestie at, iaculis at, pellentesque non, tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus non urna eget risus tempus imperdiet. Integer est diam, sagittis sit amet, posuere sit amet, bibendum sed, lacus. Aenean adipiscing cursus ipsum. Quisque at elit. Vestibulum vitae nunc. Praesent placerat metus viverra lorem. Cras nec elit congue nisi faucibus feugiat. Nam eget mi. Vestibulum condimentum. Nunc nisl ante, cursus in, dictum ac, lobortis rutrum, mi. Nulla eu nisi. In ultricies vehicula magna." + "Nunc eros dui, elementum at, ullamcorper eget, varius at, velit. Ut dictum. Cras ullamcorper ante vel tortor. Quisque viverra mauris vulputate quam. Nulla dui. Suspendisse non eros at ipsum faucibus hendrerit. Morbi dignissim pharetra tortor. Etiam malesuada. Mauris lacinia elementum erat. Duis mollis placerat metus. Nunc risus felis, cursus ac, cursus vel, convallis vel, metus. Ut vehicula nibh et nulla. Vivamus id pede. Quisque egestas arcu a ligula. Maecenas vehicula. Quisque sed ligula quis tellus tempus rutrum. Curabitur vel augue sed orci egestas pharetra. Duis pharetra."; - private OrderedLayout orderedLayout; + private AbstractOrderedLayout orderedLayout; @Override public void init() { @@ -54,7 +53,7 @@ public class Ticket2021 extends Application { p2.setCaption("OrderedLayout"); p2.setWidth("500px"); p2.setHeight("500px"); - p2.setContent(new OrderedLayout()); + p2.setContent(new VerticalLayout()); p2.getContent().setSizeFull(); w.getContent().addComponent(p2); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2029.java b/tests/src/com/vaadin/tests/tickets/Ticket2029.java index 9bf975f2ba..e79db104ad 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2029.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2029.java @@ -6,10 +6,10 @@ import com.vaadin.Application; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.terminal.UserError; +import com.vaadin.ui.Alignment; import com.vaadin.ui.Component; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -57,7 +57,7 @@ public class Ticket2029 extends Application { tf.setComponentError(new UserError("Error")); } tf.setWidth("100%"); - layout.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_BOTTOM); + layout.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); p.addComponent(tf); } @@ -95,7 +95,7 @@ public class Ticket2029 extends Application { tf.setComponentError(new UserError("Error")); } tf.setWidth("100%"); - layout.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_VERTICAL_CENTER); + layout.setComponentAlignment(tf, Alignment.MIDDLE_LEFT); p.addComponent(tf); } @@ -127,7 +127,7 @@ public class Ticket2029 extends Application { tf.setRows(2); tf.setSizeFull(); - layout.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, OrderedLayout.ALIGNMENT_BOTTOM); + layout.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); p.addComponent(tf); } diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2061b.java b/tests/src/com/vaadin/tests/tickets/Ticket2061b.java index f553a68d2b..bd523c0a7c 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2061b.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2061b.java @@ -5,11 +5,11 @@ import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.HierarchicalContainer; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Accordion; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.SplitPanel; import com.vaadin.ui.TabSheet; @@ -29,7 +29,7 @@ public class Ticket2061b extends Application implements SelectedTabChangeListene public void init() { mainWindow = new Window("Ticket 2061b"); mainWindow.setSizeFull(); - OrderedLayout mainLayout = (OrderedLayout) mainWindow.getLayout(); + AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow.getContent(); mainLayout.setSizeFull(); mainLayout.setMargin(false); setMainWindow(mainWindow); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2151.java b/tests/src/com/vaadin/tests/tickets/Ticket2151.java index fad246399f..5f6f7d80d5 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2151.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2151.java @@ -2,10 +2,10 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.util.ObjectProperty; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Window; public class Ticket2151 extends Application { @@ -17,10 +17,10 @@ public class Ticket2151 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { Button b = new Button("This is a button"); CheckBox cb = new CheckBox("This is a checkbox"); cb.setImmediate(true); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2157.java b/tests/src/com/vaadin/tests/tickets/Ticket2157.java index 302f01e0b8..25a4db4031 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2157.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2157.java @@ -1,8 +1,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -14,10 +14,10 @@ public class Ticket2157 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { VerticalLayout ol; Panel p; ComboBox cb; diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2178.java b/tests/src/com/vaadin/tests/tickets/Ticket2178.java index 4c803bba5a..15722f49c4 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2178.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2178.java @@ -1,8 +1,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -14,10 +14,10 @@ public class Ticket2178 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { VerticalLayout ol; Panel p; ComboBox cb; diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2204.java b/tests/src/com/vaadin/tests/tickets/Ticket2204.java index 59a88fe182..d9fd82f197 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2204.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2204.java @@ -10,6 +10,7 @@ import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property; import com.vaadin.data.util.BeanItem; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Accordion; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -22,7 +23,6 @@ import com.vaadin.ui.Form; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.RichTextArea; import com.vaadin.ui.SplitPanel; @@ -40,7 +40,7 @@ public class Ticket2204 extends Application { @Override public void init() { - classes.add(OrderedLayout.class); + classes.add(AbstractOrderedLayout.class); classes.add(GridLayout.class); classes.add(Accordion.class); classes.add(TabSheet.class); @@ -51,10 +51,10 @@ public class Ticket2204 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { ts = new TabSheet(); layout.addComponent(ts); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2221.java b/tests/src/com/vaadin/tests/tickets/Ticket2221.java index c12afec884..a7d3da4e35 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2221.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2221.java @@ -1,13 +1,13 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; @@ -20,10 +20,10 @@ public class Ticket2221 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { layout.setSizeFull(); layout.addComponent(new Invoice()); } diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2222.java b/tests/src/com/vaadin/tests/tickets/Ticket2222.java index 53001f0048..f44d15e8da 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2222.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2222.java @@ -1,10 +1,10 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -15,10 +15,10 @@ public class Ticket2222 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { HorizontalLayout horiz = new HorizontalLayout(); horiz.setSpacing(true); horiz.setMargin(true); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/tests/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java index 5edf4c0f13..c93b26bec2 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.data.Item; import com.vaadin.ui.Component; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; +import com.vaadin.ui.Layout; import com.vaadin.ui.Table; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -19,7 +19,7 @@ public class Ticket2227OrderedlayoutInTable extends Application { t.setHeight("200px"); t.addContainerProperty("pno", String.class, ""); t.addContainerProperty("testi", String.class, ""); - t.addContainerProperty("testi2", OrderedLayout.class, null); + t.addContainerProperty("testi2", Layout.class, null); t.addContainerProperty("komponentti", Component.class, null); t.addContainerProperty("nimi", String.class, ""); t.setVisibleColumns(new Object[] { "pno", "testi", "testi2", "nimi" }); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2231.java b/tests/src/com/vaadin/tests/tickets/Ticket2231.java index c9f773a4a4..acb86baadb 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2231.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2231.java @@ -1,8 +1,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Window; public class Ticket2231 extends Application { @@ -12,10 +12,10 @@ public class Ticket2231 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { layout.setSizeUndefined(); layout.setMargin(false); layout.setStyleName("borders"); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2234.java b/tests/src/com/vaadin/tests/tickets/Ticket2234.java index 25d74e8574..2113c02712 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2234.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2234.java @@ -2,8 +2,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.Item; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Window; public class Ticket2234 extends Application { @@ -13,10 +13,10 @@ public class Ticket2234 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { ComboBox combo = new ComboBox("Combobox caption"); combo.addContainerProperty("blah", String.class, ""); combo.setItemCaptionPropertyId("blah"); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2235.java b/tests/src/com/vaadin/tests/tickets/Ticket2235.java index 98c618453d..ed1ad67386 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2235.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2235.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.ui.OrderedLayout; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; @@ -12,10 +12,10 @@ public class Ticket2235 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { layout.setSizeFull(); TextField tf = new TextField(); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2240.java b/tests/src/com/vaadin/tests/tickets/Ticket2240.java index 6aa1659568..f23e012369 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2240.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2240.java @@ -1,8 +1,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; @@ -15,10 +15,10 @@ public class Ticket2240 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { layout.setHeight(null); layout.setStyleName("borders"); // layout.setSizeFull(); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2242.java b/tests/src/com/vaadin/tests/tickets/Ticket2242.java index 75f8506aab..eb5ea98517 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2242.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2242.java @@ -6,10 +6,10 @@ import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; import com.vaadin.data.util.ObjectProperty; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Table; import com.vaadin.ui.Window; @@ -25,10 +25,10 @@ public class Ticket2242 extends Application implements ValueChangeListener { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { Button b = new Button("Change container datasource", new ClickListener() { public void buttonClick(ClickEvent event) { diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2271.java b/tests/src/com/vaadin/tests/tickets/Ticket2271.java index 50a5466645..34b4e36c49 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2271.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2271.java @@ -1,9 +1,9 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -14,10 +14,10 @@ public class Ticket2271 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { VerticalLayout ol = new VerticalLayout(); ol.setWidth(null); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2294.java b/tests/src/com/vaadin/tests/tickets/Ticket2294.java index ba9c4fb9f1..b40ce597cd 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2294.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2294.java @@ -1,9 +1,9 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout.AlignmentHandler; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Window; public class Ticket2294 extends Application { @@ -13,10 +13,10 @@ public class Ticket2294 extends Application { Window w = new Window(getClass().getSimpleName()); setMainWindow(w); // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); + createUI((AbstractOrderedLayout) w.getLayout()); } - private void createUI(OrderedLayout layout) { + private void createUI(AbstractOrderedLayout layout) { Label label1 = new Label(); Label label2 = null; Label label3 = new Label(); diff --git a/tests/src/com/vaadin/tests/util/RandomComponents.java b/tests/src/com/vaadin/tests/util/RandomComponents.java index 6999d38e3e..8c41ea12f0 100644 --- a/tests/src/com/vaadin/tests/util/RandomComponents.java +++ b/tests/src/com/vaadin/tests/util/RandomComponents.java @@ -36,7 +36,6 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Link; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.Select; import com.vaadin.ui.TabSheet; @@ -68,21 +67,18 @@ public class RandomComponents { case 0: result = new HorizontalLayout(); - ((OrderedLayout) result).setCaption("OrderedLayout_horizontal_" - + caption); + ((HorizontalLayout) result).setCaption("OrderedLayout_horizontal_" + caption); break; case 1: result = new VerticalLayout(); - ((OrderedLayout) result).setCaption("OrderedLayout_vertical_" - + caption); + ((VerticalLayout) result).setCaption("OrderedLayout_vertical_" + caption); break; case 2: GridLayout gl; if (seededRandom.nextInt(1) > 0) { gl = new GridLayout(); } else { - gl = new GridLayout(seededRandom.nextInt(3) + 1, - seededRandom.nextInt(3) + 1); + gl = new GridLayout(seededRandom.nextInt(3) + 1, seededRandom.nextInt(3) + 1); } gl.setCaption("GridLayout_" + caption); gl.setDescription(gl.getCaption()); @@ -110,7 +106,7 @@ public class RandomComponents { if (selectedTab == i) { tabCaption = "tabX"; } - tabs.add(new OrderedLayout()); + tabs.add(new VerticalLayout()); ts.addTab(tabs.get(tabs.size() - 1), tabCaption, null); } ts.setSelectedTab(tabs.get(selectedTab)); @@ -170,12 +166,7 @@ public class RandomComponents { // Link result = new Panel(); result.setCaption("Panel component " + caption); - ((Panel) result) - .addComponent(new Label( - "Panel is a container for other components, by default it draws a frame around it's " - + "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).addComponent(new Label("Panel is a container for other components, by default it draws a frame around it's " + "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); break; case 6: @@ -193,65 +184,64 @@ public class RandomComponents { break; case 8: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new ButtonExample()); + ((VerticalLayout) result).addComponent(new ButtonExample()); break; case 9: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new ClientCachingExample()); + ((VerticalLayout) result).addComponent(new ClientCachingExample()); break; case 10: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new ComboBoxExample()); + ((VerticalLayout) result).addComponent(new ComboBoxExample()); break; case 11: result = new VerticalLayout(); // TODO: disabled gwt bug with mixed up iframe's - ((OrderedLayout) result).addComponent(new EmbeddedBrowserExample()); + ((VerticalLayout) result).addComponent(new EmbeddedBrowserExample()); break; case 12: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new JavaScriptAPIExample()); + ((VerticalLayout) result).addComponent(new JavaScriptAPIExample()); break; case 13: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new LabelExample()); + ((VerticalLayout) result).addComponent(new LabelExample()); break; case 14: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new LayoutExample()); + ((VerticalLayout) result).addComponent(new LayoutExample()); break; case 15: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new NotificationExample()); + ((VerticalLayout) result).addComponent(new NotificationExample()); break; case 16: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new RichTextExample()); + ((VerticalLayout) result).addComponent(new RichTextExample()); break; case 17: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new SelectExample()); + ((VerticalLayout) result).addComponent(new SelectExample()); break; case 18: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new ValueInputExample()); + ((VerticalLayout) result).addComponent(new ValueInputExample()); break; case 19: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new WindowingExample()); + ((VerticalLayout) result).addComponent(new WindowingExample()); break; case 20: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new TreeExample()); + ((VerticalLayout) result).addComponent(new TreeExample()); break; case 21: result = new VerticalLayout(); - ((OrderedLayout) result).addComponent(new TableExample()); + ((VerticalLayout) result).addComponent(new TableExample()); break; case 22: result = new VerticalLayout(); - ((OrderedLayout) result) - .addComponent(new StressComponentsInTable()); + ((VerticalLayout) result).addComponent(new StressComponentsInTable()); break; } @@ -275,23 +265,18 @@ public class RandomComponents { return em; } - public class MultiListener implements Button.ClickListener, - PropertySetChangeListener, ItemSetChangeListener, - ValueChangeListener { + public class MultiListener implements Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener, ValueChangeListener { public void buttonClick(ClickEvent event) { - System.out.println("ClickEvent from " - + event.getButton().getCaption()); + System.out.println("ClickEvent from " + event.getButton().getCaption()); } public void containerPropertySetChange(PropertySetChangeEvent event) { - System.out.println("containerPropertySetChange from " - + event.getContainer()); + System.out.println("containerPropertySetChange from " + event.getContainer()); } public void containerItemSetChange(ItemSetChangeEvent event) { - System.out.println("containerItemSetChange from " - + event.getContainer()); + System.out.println("containerItemSetChange from " + event.getContainer()); } public void valueChange(ValueChangeEvent event) { -- 2.39.5