From: Artur Signell Date: Thu, 11 Feb 2010 13:58:25 +0000 (+0000) Subject: Removed some old ExpandLayout references X-Git-Tag: 6.7.0.beta1~2049 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d2c718d239b03b47fbcbd3ad14346adea2eda911;p=vaadin-framework.git Removed some old ExpandLayout references svn changeset:11280/svn branch:6.3 --- diff --git a/tests/src/com/vaadin/tests/ScrollbarStressTest.java b/tests/src/com/vaadin/tests/ScrollbarStressTest.java index b6cef8353a..23a34302f8 100644 --- a/tests/src/com/vaadin/tests/ScrollbarStressTest.java +++ b/tests/src/com/vaadin/tests/ScrollbarStressTest.java @@ -4,14 +4,14 @@ import com.vaadin.Application; import com.vaadin.ui.Accordion; import com.vaadin.ui.Button; import com.vaadin.ui.Component; -import com.vaadin.ui.ExpandLayout; +import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.SplitPanel; import com.vaadin.ui.TabSheet; import com.vaadin.ui.Table; +import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; @@ -93,8 +93,7 @@ public class ScrollbarStressTest extends Application { } }); - OrderedLayout ol = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); + HorizontalLayout ol = new HorizontalLayout(); ol.addComponent(context); ol.addComponent(testComponent); ol.addComponent(width); @@ -104,17 +103,17 @@ public class ScrollbarStressTest extends Application { ol.setMargin(true); Window controller = new Window("Controller"); - controller.setLayout(ol); + controller.setContent(ol); main.addWindow(controller); } protected void drawInExpandLayout() { main.removeAllComponents(); - main.getLayout().setSizeFull(); + main.getContent().setSizeFull(); - OrderedLayout ol = new OrderedLayout(); + VerticalLayout ol = new VerticalLayout(); - ExpandLayout el = new ExpandLayout(); + VerticalLayout el = new VerticalLayout(); el.removeAllComponents(); @@ -125,18 +124,18 @@ public class ScrollbarStressTest extends Application { el.addComponent(ol); - main.getLayout().addComponent(el); + main.getContent().addComponent(el); main.removeWindow(subwindow); } protected void drawInTabSheet(boolean verticalAkaAccordion) { main.removeAllComponents(); - main.getLayout().setSizeFull(); + main.getContent().setSizeFull(); - OrderedLayout ol = new OrderedLayout(); + VerticalLayout ol = new VerticalLayout(); ol.setCaption("Tab 1"); - OrderedLayout ol2 = new OrderedLayout(); + VerticalLayout ol2 = new VerticalLayout(); ol2.setCaption("Tab 2"); TabSheet ts = (verticalAkaAccordion ? accordion : tabsheet); @@ -162,10 +161,10 @@ public class ScrollbarStressTest extends Application { private void drawInSplitPanel() { main.removeAllComponents(); - main.getLayout().setSizeFull(); + main.getContent().setSizeFull(); - OrderedLayout ol = new OrderedLayout(); - OrderedLayout ol2 = new OrderedLayout(); + VerticalLayout ol = new VerticalLayout(); + VerticalLayout ol2 = new VerticalLayout(); splitPanel.setFirstComponent(ol); splitPanel.setSecondComponent(ol2); @@ -185,11 +184,11 @@ public class ScrollbarStressTest extends Application { private void drawInPanel() { main.removeAllComponents(); - main.getLayout().setSizeFull(); + main.getContent().setSizeFull(); - OrderedLayout ol = new OrderedLayout(); + VerticalLayout ol = new VerticalLayout(); panel.setSizeFull(); - panel.setLayout(ol); + panel.setContent(ol); ol.setWidth((String) width.getValue()); ol.setHeight((String) height.getValue()); @@ -201,20 +200,20 @@ public class ScrollbarStressTest extends Application { private void drawInSubwindow() { main.removeAllComponents(); - main.getLayout().setSizeFull(); - OrderedLayout ol = new OrderedLayout(); + main.getContent().setSizeFull(); + VerticalLayout ol = new VerticalLayout(); ol.setWidth((String) width.getValue()); ol.setHeight((String) height.getValue()); ol.addComponent(getTestComponent()); - subwindow.setLayout(ol); + subwindow.setContent(ol); main.addWindow(subwindow); } private void drawInMainWindow() { main.removeAllComponents(); - OrderedLayout ol = new OrderedLayout(); - main.setLayout(ol); + VerticalLayout ol = new VerticalLayout(); + main.setContent(ol); ol.setWidth((String) width.getValue()); ol.setHeight((String) height.getValue()); diff --git a/tests/src/com/vaadin/tests/TestBench.java b/tests/src/com/vaadin/tests/TestBench.java index c3d7155b50..be3471c02d 100644 --- a/tests/src/com/vaadin/tests/TestBench.java +++ b/tests/src/com/vaadin/tests/TestBench.java @@ -18,7 +18,6 @@ import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.ExpandLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Link; @@ -201,13 +200,13 @@ public class TestBench extends com.vaadin.Application implements bodyLayout.addStyleName("light"); bodyLayout.setSizeFull(); - bodyLayout.setLayout(new ExpandLayout()); + bodyLayout.setContent(new VerticalLayout()); mainLayout.addComponent(bodyLayout); mainLayout.setSplitPosition(30); - mainWindow.setLayout(mainLayout); + mainWindow.setContent(mainLayout); setMainWindow(mainWindow); } diff --git a/tests/src/com/vaadin/tests/TestCaptionWrapper.java b/tests/src/com/vaadin/tests/TestCaptionWrapper.java index c15270458e..82ae63f26e 100644 --- a/tests/src/com/vaadin/tests/TestCaptionWrapper.java +++ b/tests/src/com/vaadin/tests/TestCaptionWrapper.java @@ -14,14 +14,12 @@ import com.vaadin.ui.CheckBox; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.DateField; import com.vaadin.ui.Embedded; -import com.vaadin.ui.ExpandLayout; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; import com.vaadin.ui.Link; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.ProgressIndicator; import com.vaadin.ui.RichTextArea; @@ -33,12 +31,13 @@ import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; import com.vaadin.ui.TwinColSelect; import com.vaadin.ui.Upload; +import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; import com.vaadin.ui.Component.Listener; public class TestCaptionWrapper extends CustomComponent implements Listener { - OrderedLayout main = new OrderedLayout(); + VerticalLayout main = new VerticalLayout(); final String eventListenerString = "Component.Listener feedback: "; Label eventListenerFeedback = new Label(eventListenerString @@ -72,13 +71,13 @@ public class TestCaptionWrapper extends CustomComponent implements Listener { final Panel panel = new Panel("Panel"); test(panel); - populateLayout(panel.getLayout()); + populateLayout((Layout) panel.getContent()); final TabSheet tabsheet = new TabSheet(); test(tabsheet); - final OrderedLayout tab1 = new OrderedLayout(); + final VerticalLayout tab1 = new VerticalLayout(); tab1.addComponent(new Label("try tab2")); - final OrderedLayout tab2 = new OrderedLayout(); + final VerticalLayout tab2 = new VerticalLayout(); test(tab2); populateLayout(tab2); tabsheet.addTab(tab1, "TabSheet tab1", new ClassResource("m.gif", @@ -86,7 +85,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener { tabsheet.addTab(tab2, "TabSheet tab2", new ClassResource("m.gif", getApplication())); - final ExpandLayout expandLayout = new ExpandLayout(); + final VerticalLayout expandLayout = new VerticalLayout(); test(expandLayout); populateLayout(expandLayout); @@ -96,7 +95,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener { final Window window = new Window("TEST: Window"); test(window); - populateLayout(window.getLayout()); + populateLayout((Layout) window.getContent()); } diff --git a/tests/src/com/vaadin/tests/TestComponentsAndLayouts.java b/tests/src/com/vaadin/tests/TestComponentsAndLayouts.java index 5187f8f8e6..ba9fbe86d0 100644 --- a/tests/src/com/vaadin/tests/TestComponentsAndLayouts.java +++ b/tests/src/com/vaadin/tests/TestComponentsAndLayouts.java @@ -26,7 +26,6 @@ import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.DateField; import com.vaadin.ui.Embedded; -import com.vaadin.ui.ExpandLayout; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; @@ -45,6 +44,7 @@ import com.vaadin.ui.TextField; import com.vaadin.ui.Tree; import com.vaadin.ui.TwinColSelect; import com.vaadin.ui.Upload; +import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; import com.vaadin.ui.Component.Event; import com.vaadin.ui.Component.Listener; @@ -194,20 +194,6 @@ public class TestComponentsAndLayouts extends Application implements Listener, // test(gridLayout); } - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target - .addComponent(new Label( - "

Components inside ExpandLayout (height 250px)

", - Label.CONTENT_XHTML)); - final ExpandLayout el = new ExpandLayout(); - el.setHeight(250, Component.UNITS_PIXELS); - el.expand(new Label("This label will expand on expand layout")); - populateLayout(el); - target.addComponent(el); - } - // ////////////////////////////////////////////////////////////////////// // //// if (false) { @@ -219,27 +205,6 @@ public class TestComponentsAndLayouts extends Application implements Listener, target.addComponent(panel); } - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target - .addComponent(new Label( - "

Components inside vertical SplitPanel (splitpanel is under 250height ExpandLayout)

", - Label.CONTENT_XHTML)); - final ExpandLayout sp1l = new ExpandLayout(); - sp1l.setHeight(250, ExpandLayout.UNITS_PIXELS); - final SplitPanel sp1 = new SplitPanel( - SplitPanel.ORIENTATION_VERTICAL); - sp1l.addComponent(sp1); - final OrderedLayout sp1first = new OrderedLayout(); - final OrderedLayout sp1second = new OrderedLayout(); - sp1.setFirstComponent(sp1first); - populateLayout(sp1first); - populateLayout(sp1second); - sp1.setSecondComponent(sp1second); - target.addComponent(sp1l); - } - // ////////////////////////////////////////////////////////////////////// // //// if (false) { @@ -247,13 +212,13 @@ public class TestComponentsAndLayouts extends Application implements Listener, .addComponent(new Label( "

Components inside horizontal SplitPanel (splitpanel is under 250px height ExpandLayout)

", Label.CONTENT_XHTML)); - final ExpandLayout sp2l = new ExpandLayout(); + final VerticalLayout sp2l = new VerticalLayout(); sp2l.setHeight(250, SplitPanel.UNITS_PIXELS); final SplitPanel sp2 = new SplitPanel( SplitPanel.ORIENTATION_HORIZONTAL); sp2l.addComponent(sp2); - final OrderedLayout sp2first = new OrderedLayout(); - final OrderedLayout sp2second = new OrderedLayout(); + final VerticalLayout sp2first = new VerticalLayout(); + final VerticalLayout sp2second = new VerticalLayout(); sp2.setFirstComponent(sp2first); populateLayout(sp2first); populateLayout(sp2second); @@ -278,8 +243,8 @@ public class TestComponentsAndLayouts extends Application implements Listener, final Embedded emb = new Embedded("Embedded " + count++, flashResource); emb.setType(Embedded.TYPE_OBJECT); emb.setMimeType("application/x-shockwave-flash"); - emb.setWidth(250); - emb.setHeight(100); + emb.setWidth("250px"); + emb.setHeight("100px"); test(layout, emb); final Panel panel = new Panel("Panel " + count++); @@ -333,9 +298,9 @@ public class TestComponentsAndLayouts extends Application implements Listener, test(layout, table); final TabSheet tabsheet = new TabSheet(); - final OrderedLayout tab1 = new OrderedLayout(); + final VerticalLayout tab1 = new VerticalLayout(); tab1.addComponent(new Label("tab1 " + count++)); - final OrderedLayout tab2 = new OrderedLayout(); + final VerticalLayout tab2 = new VerticalLayout(); tab2.addComponent(new Label("tab2 " + count++)); tabsheet.addTab(tab1, "Default (not configured) TabSheet tab1", new ClassResource("m.gif", this)); @@ -344,9 +309,9 @@ public class TestComponentsAndLayouts extends Application implements Listener, test(layout, tabsheet); final Accordion accordion = new Accordion(); - final OrderedLayout acc1 = new OrderedLayout(); + final VerticalLayout acc1 = new VerticalLayout(); acc1.addComponent(new Label("acc1 " + count++)); - final OrderedLayout acc2 = new OrderedLayout(); + final VerticalLayout acc2 = new VerticalLayout(); acc2.addComponent(new Label("acc2 " + count++)); accordion.addTab(acc1, "Default (not configured) Accordion acc1", new ClassResource("m.gif", this)); diff --git a/tests/src/com/vaadin/tests/TestForExpandLayout.java b/tests/src/com/vaadin/tests/TestForExpandLayout.java deleted file mode 100644 index e58ec24161..0000000000 --- a/tests/src/com/vaadin/tests/TestForExpandLayout.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; - -/** - * - * @author IT Mill Ltd. - */ -public class TestForExpandLayout extends CustomComponent { - - ExpandLayout main = new ExpandLayout(); - - DateField df; - - public TestForExpandLayout() { - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - for (int i = 0; i < 6; i++) { - final ExpandLayout el = new ExpandLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - for (int j = 0; j < i + 3; j++) { - final Label l = new Label("label" + i + ":" + j); - el.addComponent(l); - } - if (i > 0) { - // el.setMargin(true); - el.setSizeUndefined(); - el.setWidth("100%"); - if (i % 2 == 0) { - el.setHeight("8em"); - Panel p = new Panel("tp"); - p.addComponent(new Label("panelc")); - p.setHeight("100%"); - p.setWidth("100px"); - el.addComponent(p); - } - } - main.addComponent(el); - } - - } -} diff --git a/tests/src/com/vaadin/tests/TestForExpandLayout2.java b/tests/src/com/vaadin/tests/TestForExpandLayout2.java deleted file mode 100644 index 5c6ff7955b..0000000000 --- a/tests/src/com/vaadin/tests/TestForExpandLayout2.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; - -/** - * - * @author IT Mill Ltd. - */ -public class TestForExpandLayout2 extends CustomComponent { - - ExpandLayout main; - - public TestForExpandLayout2() { - createNewView(); - setCompositionRoot(main); - } - - public void createNewView() { - main = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - Panel left = new Panel("Left column"); - left.setHeight(100, Panel.UNITS_PERCENTAGE); - left.setWidth(150); - main.addComponent(left); - - ExpandLayout center = new ExpandLayout(); - center.addComponent(new Label("header")); - Panel mainContent = new Panel(); - center.addComponent(mainContent); - center.expand(mainContent); - mainContent.setSizeFull(); - - ExpandLayout buttons = new ExpandLayout( - ExpandLayout.ORIENTATION_HORIZONTAL); - buttons.setHeight(30, ExpandLayout.UNITS_PIXELS); - Button b1 = new Button("Save"); - Button b2 = new Button("Cancel"); - Button b3 = new Button("Logout"); - buttons.addComponent(b1); - buttons.setComponentAlignment(b1, ExpandLayout.ALIGNMENT_RIGHT, - ExpandLayout.ALIGNMENT_TOP); - buttons.addComponent(b2); - buttons.addComponent(b3); - center.addComponent(buttons); - - main.addComponent(center); - main.expand(center); - - Panel right = new Panel("Right column"); - right.setHeight(100, Panel.UNITS_PERCENTAGE); - right.setWidth(200); - - main.addComponent(right); - - } -} diff --git a/tests/src/com/vaadin/tests/TestForExpandLayout3.java b/tests/src/com/vaadin/tests/TestForExpandLayout3.java deleted file mode 100644 index ae4adfcfaa..0000000000 --- a/tests/src/com/vaadin/tests/TestForExpandLayout3.java +++ /dev/null @@ -1,79 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.ExpandLayout; - -/** - * - * @author IT Mill Ltd. - */ -public class TestForExpandLayout3 extends CustomComponent { - - ExpandLayout main = new ExpandLayout(); - - DateField df; - - public TestForExpandLayout3() { - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - - ExpandLayout el; - Button b; - Button b2; - - el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - b = new Button("SDFS"); - b2 = new Button("DSFSDFDFSSDF"); - - el.addComponent(b); - el.addComponent(b2); - - el.expand(b); - el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_RIGHT, - ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - main.addComponent(el); - - el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - b = new Button("SDFS"); - b2 = new Button("DSFSDFDFSSDF"); - - el.addComponent(b); - el.addComponent(b2); - - el.expand(b); - el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_HORIZONTAL_CENTER, - ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - el.setHeight(60, ExpandLayout.UNITS_PIXELS); - el.setMargin(true); - main.addComponent(el); - - el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - b = new Button("SDFS"); - b2 = new Button("DSFSDFDFSSDF"); - - el.addComponent(b); - el.addComponent(b2); - - el.expand(b); - el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_RIGHT, - ExpandLayout.ALIGNMENT_BOTTOM); - el.setHeight(100, ExpandLayout.UNITS_PIXELS); - el.setSpacing(true); - - main.addComponent(el); - - } -} diff --git a/tests/src/com/vaadin/tests/TestSizeableIncomponents.java b/tests/src/com/vaadin/tests/TestSizeableIncomponents.java index 7c9788e640..7deb4479fa 100644 --- a/tests/src/com/vaadin/tests/TestSizeableIncomponents.java +++ b/tests/src/com/vaadin/tests/TestSizeableIncomponents.java @@ -21,11 +21,11 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.Embedded; -import com.vaadin.ui.ExpandLayout; +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.VerticalLayout; import com.vaadin.ui.Window; import com.vaadin.ui.Button.ClickEvent; @@ -46,8 +46,8 @@ public class TestSizeableIncomponents extends Application { setMainWindow(w); w.setTheme("demo"); - final ExpandLayout main = new ExpandLayout(); - w.setLayout(main); + final VerticalLayout main = new VerticalLayout(); + w.setContent(main); select = new ComboBox(); select.setImmediate(true); @@ -85,8 +85,7 @@ public class TestSizeableIncomponents extends Application { } }); - OrderedLayout controllers = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); + HorizontalLayout controllers = new HorizontalLayout(); controllers.addComponent(prev); controllers.addComponent(select); controllers.addComponent(next); @@ -116,10 +115,10 @@ public class TestSizeableIncomponents extends Application { testPanel = new Panel(); testPanel.setSizeFull(); - testPanel.setLayout(new ExpandLayout()); + testPanel.setContent(new VerticalLayout()); testPanel.setStyleName("testable"); main.addComponent(testPanel); - main.expand(testPanel); + main.setExpandRatio(testPanel, 1); } @@ -147,8 +146,8 @@ public class TestSizeableIncomponents extends Application { t.addConfiguration(new Configuration("100px*100px") { @Override void configure(Component c) { - c.setWidth(60); - c.setHeight(60); + c.setWidth("60px"); + c.setHeight("60px"); } }); t = new Testable(c); @@ -177,7 +176,7 @@ public class TestSizeableIncomponents extends Application { Panel p = new Panel( "Wrapper panel (400px*400px)"); - p.setLayout(new ExpandLayout()); + p.setContent(new VerticalLayout()); p.setWidth("400px"); p.setHeight("400px"); p.addComponent(c); diff --git a/tests/src/com/vaadin/tests/TreeFilesystemContainer.java b/tests/src/com/vaadin/tests/TreeFilesystemContainer.java index 52154fbe22..690555b3ad 100644 --- a/tests/src/com/vaadin/tests/TreeFilesystemContainer.java +++ b/tests/src/com/vaadin/tests/TreeFilesystemContainer.java @@ -9,11 +9,11 @@ import java.io.File; import com.vaadin.data.util.FilesystemContainer; import com.vaadin.data.util.FilesystemContainer.FileItem; import com.vaadin.demo.util.SampleDirectory; -import com.vaadin.ui.ExpandLayout; import com.vaadin.ui.Field; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; import com.vaadin.ui.Tree; +import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; import com.vaadin.ui.Component.Event; import com.vaadin.ui.Component.Listener; @@ -45,17 +45,16 @@ public class TreeFilesystemContainer extends com.vaadin.Application implements public void init() { final Window w = new Window("Tree FilesystemContainer demo"); setMainWindow(w); - final ExpandLayout main = new ExpandLayout(); - w.setLayout(main); + final VerticalLayout main = new VerticalLayout(); + w.setContent(main); main.setMargin(true); main.setSpacing(true); - propertyPanel.setHeight(120); + propertyPanel.setHeight("120px"); main.addComponent(propertyPanel); - explorerPanel.setHeight(100); - explorerPanel.setHeightUnits(Panel.UNITS_PERCENTAGE); + explorerPanel.setHeight("100%"); main.addComponent(explorerPanel); - main.expand(explorerPanel); + main.setExpandRatio(explorerPanel, 1); // Explorer panel contains tree explorerPanel.addComponent(filesystem); diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1902.java b/tests/src/com/vaadin/tests/tickets/Ticket1902.java deleted file mode 100644 index 716b6b94f0..0000000000 --- a/tests/src/com/vaadin/tests/tickets/Ticket1902.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1902 extends Application { - - @Override - public void init() { - - // Main layout and main window - final OrderedLayout mainLayout = new OrderedLayout(); - setMainWindow(new Window("Testcase for #1902", mainLayout)); - setTheme("tests-tickets"); - mainLayout.setMargin(false); - mainLayout.setSpacing(true); - mainLayout.addComponent(new Button("mainLayout.setSizeFull()", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - mainLayout.setSizeFull(); - getMainWindow().showNotification( - "Set the main layout size full"); - } - })); - mainLayout.addComponent(new Button("mainLayout.setWidth(\"100%\")", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - mainLayout.setWidth("100%"); - getMainWindow().showNotification( - "Set the main layout width 100%"); - } - })); - - // 100% wide component - TextField b2 = new TextField("100% wide field"); - mainLayout.addComponent(b2); - b2.setWidth("100%"); - - // 400px wide colored layout - OrderedLayout lo = new OrderedLayout(); - lo.setStyleName("red-background"); - mainLayout.addComponent(lo); - lo.setWidth(400); - - Button b = new Button("100% wide button"); - lo.addComponent(b); - b.setWidth("100%"); - - TextField tf = new TextField("100% wide textfield"); - lo.addComponent(tf); - tf.setWidth("100%"); - - // 400x100 colored layout - OrderedLayout lo2 = new OrderedLayout(); - lo2.setStyleName("red-background"); - mainLayout.addComponent(lo2); - lo2.setWidth("50%"); - lo2.setHeight(200); - - Button b3 = new Button("100% wide button"); - lo2.addComponent(b3); - b3.setWidth("100%"); - - TextField tf2 = new TextField("100% wide textfield"); - lo2.addComponent(tf2); - tf2.setWidth("100%"); - // tf2 = new TextField("50% wide, 100% height textfield"); // does not - // work with caption (10.7.2008 mac hosted mode) due layouts are broken - // in trunk - tf2 = new TextField(); - tf2.setRows(2); // trigger textArea impl. - tf2.setHeight("100%"); - tf2.setWidth("50%"); - lo2.addComponent(tf2); - } -} \ No newline at end of file diff --git a/tests/src/com/vaadin/tests/tickets/Ticket1934.java b/tests/src/com/vaadin/tests/tickets/Ticket1934.java deleted file mode 100644 index b80dfc07e0..0000000000 --- a/tests/src/com/vaadin/tests/tickets/Ticket1934.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -public class Ticket1934 extends Application { - - @Override - public void init() { - Window w = new Window( - "#1934 : Horizontal ExpandLayout completely broken"); - setMainWindow(w); - w.addComponent(new Label( - "Horizontal 500x200 ExpandLayout with two components:")); - - ExpandLayout testedLayout = new ExpandLayout( - ExpandLayout.ORIENTATION_HORIZONTAL); - testedLayout.setWidth("500px"); - testedLayout.setHeight("200px"); - - Button b1 = new Button("b1"); - testedLayout.addComponent(b1); - testedLayout.expand(b1); - testedLayout.addComponent(new Button("b2")); - - w.addComponent(testedLayout); - } - -} diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2032.java b/tests/src/com/vaadin/tests/tickets/Ticket2032.java deleted file mode 100644 index f51984f336..0000000000 --- a/tests/src/com/vaadin/tests/tickets/Ticket2032.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2032 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - ExpandLayout el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - Panel p = new Panel(el); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("Field caption"); - tf.setValue("Expanded"); - el.addComponent(tf); - el.expand(tf); - tf.setSizeFull(); - - tf = new TextField("Vertical bottom"); - // tf.setComponentError(new UserError("Error")); - tf.setValue("Vertical bottom"); - el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - ExpandLayout.ALIGNMENT_BOTTOM); - el.addComponent(tf); - - tf = new TextField("Vertical top"); - tf.setComponentError(new UserError("Error")); - el.addComponent(tf); - tf.setValue("Vertical top"); - el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("Vertical center"); - el.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - layout.addComponent(p); - } -} diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2033.java b/tests/src/com/vaadin/tests/tickets/Ticket2033.java deleted file mode 100644 index 744195619e..0000000000 --- a/tests/src/com/vaadin/tests/tickets/Ticket2033.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2033 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(2, 2); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - layout.addComponent(createExpandLayoutPanel()); - layout.addComponent(createOrderedLayoutPanel()); - layout.addComponent(createGridLayoutPanel()); - } - - private Panel createExpandLayoutPanel() { - ExpandLayout el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - Panel p = new Panel("ExpandLayout", el); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("TextField 1"); - tf.setValue("Expanded"); - el.addComponent(tf); - el.expand(tf); - tf.setSizeFull(); - - tf = new TextField("TextField 2 has a longer caption"); - // tf.setComponentError(new UserError("Error")); - tf.setWidth(100); - tf.setValue("Vertical bottom"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_BOTTOM); - el.addComponent(tf); - - tf = new TextField( - "TextField 3 has a very, very long caption for some weird reason."); - tf.setWidth(100); - tf.setComponentError(new UserError("Error")); - el.addComponent(tf); - tf.setValue("Vertical top"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("TextField 4"); - el.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - return p; - } - - private Panel createOrderedLayoutPanel() { - OrderedLayout ol = new OrderedLayout( - ExpandLayout.ORIENTATION_HORIZONTAL); - Panel p = new Panel("OrderedLayout", ol); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("TextField 1"); - tf.setValue("Expanded"); - ol.addComponent(tf); - // ol.expand(tf); - tf.setSizeFull(); - - tf = new TextField("TextField 2 has a longer caption"); - // tf.setComponentError(new UserError("Error")); - tf.setWidth(100); - tf.setValue("Vertical bottom"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_BOTTOM); - ol.addComponent(tf); - - tf = new TextField( - "TextField 3 has a very, very long caption for some weird reason."); - tf.setWidth(100); - tf.setComponentError(new UserError("Error")); - ol.addComponent(tf); - tf.setValue("Vertical top"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("TextField 4"); - ol.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - return p; - } - - private Panel createGridLayoutPanel() { - GridLayout gl = new GridLayout(4, 1); - Panel p = new Panel("GridLayout", gl); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("TextField 1"); - tf.setValue("Expanded"); - gl.addComponent(tf); - // ol.expand(tf); - tf.setSizeFull(); - - tf = new TextField("TextField 2 has a longer caption"); - // tf.setComponentError(new UserError("Error")); - tf.setWidth(100); - tf.setValue("Vertical bottom"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_BOTTOM); - gl.addComponent(tf); - - tf = new TextField( - "TextField 3 has a very, very long caption for some weird reason."); - tf.setWidth(100); - tf.setComponentError(new UserError("Error")); - gl.addComponent(tf); - tf.setValue("Vertical top"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("TextField 4"); - gl.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - return p; - } -} diff --git a/tests/src/com/vaadin/tests/tickets/Ticket2061c.java b/tests/src/com/vaadin/tests/tickets/Ticket2061c.java index 77381dcbfd..9f4b754325 100644 --- a/tests/src/com/vaadin/tests/tickets/Ticket2061c.java +++ b/tests/src/com/vaadin/tests/tickets/Ticket2061c.java @@ -8,12 +8,11 @@ import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.ui.Accordion; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.ExpandLayout; import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.TabSheet; import com.vaadin.ui.Table; +import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; import com.vaadin.ui.TabSheet.SelectedTabChangeListener; @@ -28,14 +27,14 @@ public class Ticket2061c extends Application implements public void init() { mainWindow = new Window("Vaadin"); mainWindow.setSizeFull(); - mainWindow.getLayout().setSizeFull(); + mainWindow.getContent().setSizeFull(); setMainWindow(mainWindow); - OrderedLayout ol = new OrderedLayout(); + VerticalLayout ol = new VerticalLayout(); ol.setWidth("200px"); ol.setHeight("200px"); - OrderedLayout ol2 = new OrderedLayout(); + VerticalLayout ol2 = new VerticalLayout(); ol2.setSizeFull(); p = new Panel("This is a panel"); @@ -63,7 +62,7 @@ public class Ticket2061c extends Application implements private Table table = new Table(); private String[] columns; - private ExpandLayout layout = new ExpandLayout(); + private VerticalLayout layout = new VerticalLayout(); public MyTable(int columnNumber, String id) { setDebugId(id);