diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-15 11:06:18 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-04-15 14:00:58 +0300 |
commit | 6b8412033e680ce6e5c7827ac504adf132305726 (patch) | |
tree | 0df05d16c324b285610af8910c126b58f4c490c5 /uitest/src/com/vaadin/tests/tickets | |
parent | 9192b0bb5e5e699b506b3d3e7df4cf295fbea44a (diff) | |
download | vaadin-framework-6b8412033e680ce6e5c7827ac504adf132305726.tar.gz vaadin-framework-6b8412033e680ce6e5c7827ac504adf132305726.zip |
Build uitest war with maven
Change-Id: I32625901ca27a282253df44c6e776cf9632bacda
Diffstat (limited to 'uitest/src/com/vaadin/tests/tickets')
182 files changed, 0 insertions, 13275 deletions
diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1225.java b/uitest/src/com/vaadin/tests/tickets/Ticket1225.java deleted file mode 100644 index 019e84daf3..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1225.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.VerticalSplitPanel; - -/** - * With IE7 extra scrollbars appear in content area all though content fits - * properly. Scrollbars will disappear if "shaking" content a bit, like - * selecting tests in area. - */ -public class Ticket1225 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow( - "Test app to break layout fuction in IE7"); - setMainWindow(mainWin); - - VerticalSplitPanel sp = new VerticalSplitPanel(); - - sp.setFirstComponent(new Label("First")); - - VerticalLayout el = new VerticalLayout(); - - sp.setSecondComponent(el); - el.setMargin(true); - el.setSizeFull(); - - el.addComponent(new Label("Top")); - - Table testTable = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(5, 50); - testTable.setSizeFull(); - - TabSheet ts = new TabSheet(); - ts.setSizeFull(); - - Label red = new Label( - "<div style='background:red;width:100%;height:100%;'>??</div>", - ContentMode.HTML); - // red.setCaption("cap"); - // red.setSizeFull(); - - // el.addComponent(testTable); - // el.setExpandRatio(testTable,1); - - el.addComponent(ts); - el.setExpandRatio(ts, 1); - ts.addComponent(red); - ts.getTab(red).setCaption("REd tab"); - - Label l = new Label("<div style='background:blue;'>sdf</div>", - ContentMode.HTML); - el.addComponent(l); - el.setComponentAlignment(l, Alignment.MIDDLE_RIGHT); - - mainWin.setContent(sp); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1230.java b/uitest/src/com/vaadin/tests/tickets/Ticket1230.java deleted file mode 100644 index 3a707934b6..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1230.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Select; - -public class Ticket1230 extends LegacyApplication { - - private static final Object PROPERTY_ID = new Object(); - private static final Object NULL_ITEM_ID = new Object(); - private Select selectWithoutNullItem; - private Select selectWithNullItem; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - - GridLayout layout = new GridLayout(5, 5); - w.setContent(layout); - - layout.setSpacing(true); - - { - selectWithoutNullItem = createSelect(); - - layout.addComponent(selectWithoutNullItem); - Button b = new Button("Select NULL_PROPERTY", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select(NULL_ITEM_ID); - printState(); - - } - }); - layout.addComponent(b); - b = new Button("Select 1", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select("1"); - printState(); - - } - }); - layout.addComponent(b); - b = new Button("Select 2", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select("2"); - printState(); - - } - }); - layout.addComponent(b); - - b = new Button("Select null", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select(null); - printState(); - - } - }); - layout.addComponent(b); - } - - { - selectWithNullItem = createSelect(); - Item nullItem = selectWithNullItem.addItem(NULL_ITEM_ID); - nullItem.getItemProperty(PROPERTY_ID).setValue("NULL"); - selectWithNullItem.setNullSelectionItemId(NULL_ITEM_ID); - - layout.addComponent(selectWithNullItem); - selectWithNullItem.setCaption("Select with null item id"); - Button b = new Button("Select NULL_PROPERTY", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithNullItem.select(NULL_ITEM_ID); - printState(); - - } - }); - layout.addComponent(b); - - b = new Button("Select 1", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithNullItem.select("1"); - printState(); - - } - }); - layout.addComponent(b); - b = new Button("Select 2", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithNullItem.select("2"); - printState(); - } - }); - layout.addComponent(b); - - b = new Button("Select null", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - selectWithNullItem.select(null); - printState(); - } - }); - layout.addComponent(b); - - } - - w.addComponent(new Button("print select values", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - printState(); - } - })); - } - - @SuppressWarnings("deprecation") - private Select createSelect() { - Select select = new Select(); - select.addContainerProperty(PROPERTY_ID, String.class, ""); - select.setItemCaptionPropertyId(PROPERTY_ID); - - Item item1 = select.addItem("1"); - item1.getItemProperty(PROPERTY_ID).setValue("1"); - Item item2 = select.addItem("2"); - item2.getItemProperty(PROPERTY_ID).setValue("2"); - - select.setNullSelectionAllowed(true); - - return select; - } - - void printState() { - System.out.println(" Select without null item " - + selectWithoutNullItem.getValue()); - System.out.println(" Select with null item " - + selectWithNullItem.getValue()); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket124.java b/uitest/src/com/vaadin/tests/tickets/Ticket124.java deleted file mode 100644 index 3c2724e991..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket124.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket124 extends LegacyApplication { - - private TextField tf; - private GridLayout gl; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow( - "#124: Insert & remove row for GridLayout"); - setMainWindow(w); - setTheme("tests-tickets"); - // gl = new GridLayout(4, 4); - gl = new GridLayout(2, 2); - - tf = new TextField("Row nr"); - Button insert = new Button("Insert row", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - insertRow(); - - } - }); - Button delete = new Button("Delete row", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - deleteRow(); - - } - }); - - // gl.addComponent(new Label("0-0"), 0, 0); - // gl.addComponent(new Label("0-1"), 1, 0); - gl.addComponent(new Label("1-0"), 1, 0); - gl.addComponent(new Label("1-1"), 1, 1); - gl.addComponent(new Label("0,0-1,0"), 0, 0, 1, 0); - gl.addComponent(new Label("2,0-3,0"), 2, 0, 3, 0); - Label l = new Label("Large cell 0,1-2,2<br/>yadayada<br/>lorem ipsum"); - l.setContentMode(ContentMode.HTML); - gl.addComponent(l, 0, 1, 2, 2); - gl.addComponent(new Label("3-1"), 3, 1); - gl.addComponent(new Label("3,2-3,3"), 3, 2, 3, 3); - gl.addComponent(tf, 0, 3); - gl.addComponent(insert, 1, 3); - gl.addComponent(delete, 2, 3); - - gl.setStyleName("border"); - w.addComponent(gl); - } - - protected void deleteRow() { - int pos = Integer.parseInt(tf.getValue().toString()); - gl.removeRow(pos); - - } - - protected void clearRow() { - int pos = Integer.parseInt(tf.getValue().toString()); - for (int col = 0; col < gl.getColumns(); col++) { - try { - gl.removeComponent(col, pos); - } catch (Exception e) { - e.printStackTrace(); - } - } - - } - - protected void insertRow() { - int pos = Integer.parseInt(tf.getValue().toString()); - gl.insertRow(pos); - try { - TextField t = new TextField("", "Newly added row"); - t.setWidth("100%"); - gl.addComponent(t, 0, pos, 3, pos); - } catch (Exception e) { - // TODO: handle exception - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1245.java b/uitest/src/com/vaadin/tests/tickets/Ticket1245.java deleted file mode 100644 index 082363a1e5..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1245.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.themes.Reindeer; - -public class Ticket1245 extends com.vaadin.server.LegacyApplication { - - TextField f = new TextField(); - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.addComponent(new TreeExample()); - } -} - -class TreeExample extends CustomComponent { - - // Id for the caption property - private static final Object CAPTION_PROPERTY = "caption"; - - private static final String desc = "non-first tree in non-sized orderedlayout seems to be the problem"; - - Tree tree; - - public TreeExample() { - final VerticalLayout main = new VerticalLayout(); - setCompositionRoot(main); - - // Panel w/ Tree - main.setStyleName(Reindeer.PANEL_LIGHT); - main.setWidth("200px"); - // // Description, this is needed. Works in first slot - main.addComponent(new Label(desc)); - - // setting either width or height fixes the issue - // p.setWidth(500); - // p.setHeight(800); - - // Tree with a few items - tree = new Tree(); - tree.setImmediate(true); - // we'll use a property for caption instead of the item id ("value"), - // so that multiple items can have the same caption - tree.addContainerProperty(CAPTION_PROPERTY, String.class, ""); - tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); - tree.setItemCaptionPropertyId(CAPTION_PROPERTY); - for (int i = 1; i <= 3; i++) { - final Object id = addCaptionedItem("Section " + i, null); - tree.expandItem(id); - addCaptionedItem("Team A", id); - addCaptionedItem("Team B", id); - } - main.addComponent(tree); - } - - /** - * Helper to add an item with specified caption and (optional) parent. - * - * @param caption - * The item caption - * @param parent - * The (optional) parent item id - * @return the created item's id - */ - private Object addCaptionedItem(String caption, Object parent) { - // add item, let tree decide id - final Object id = tree.addItem(); - // get the created item - final Item item = tree.getItem(id); - // set our "caption" property - final Property<String> p = item.getItemProperty(CAPTION_PROPERTY); - p.setValue(caption); - if (parent != null) { - tree.setChildrenAllowed(parent, true); - tree.setParent(id, parent); - tree.setChildrenAllowed(id, false); - } - return id; - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket12727.java b/uitest/src/com/vaadin/tests/tickets/Ticket12727.java deleted file mode 100644 index 40711c6b7f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket12727.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; - -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.Panel; -import com.vaadin.ui.UI; -import com.vaadin.ui.VerticalLayout; - -/** - * Test for #12727: Panels get unnecessary scroll bars in WebKit when content is - * 100% wide. - */ -@SuppressWarnings("serial") -public class Ticket12727 extends UI { - - @Override - protected void init(VaadinRequest request) { - Panel panel = new Panel(); - - VerticalLayout content = new VerticalLayout(); - panel.setContent(content); - - GridLayout gridLayout = new GridLayout(); - gridLayout.setHeight(null); - gridLayout.setWidth(100, Unit.PERCENTAGE); - content.addComponent(gridLayout); - - ListSelect listSelect = new ListSelect(); - - listSelect.setWidth(100, Unit.PERCENTAGE); - listSelect.setHeight(500, Unit.PIXELS); - - gridLayout.addComponent(listSelect); - - ArrayList<String> values = new ArrayList<String>(); - values.add("Value 1"); - values.add("Value 2"); - values.add("Value 3"); - - ComboBox comboBox = new ComboBox(null, values); - gridLayout.addComponent(comboBox); - - gridLayout.setMargin(true); - - setContent(panel); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1365.java b/uitest/src/com/vaadin/tests/tickets/Ticket1365.java deleted file mode 100644 index 04c1645d98..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1365.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.event.Action; -import com.vaadin.event.Action.Handler; -import com.vaadin.event.ShortcutAction; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1365 extends com.vaadin.server.LegacyApplication implements - Handler { - - TextField f = new TextField(); - - Label status = new Label("ENTER and CTRL-S fires shortcut action."); - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.addComponent(f); - main.addComponent(status); - main.addActionHandler(this); - f.focus(); - - } - - final static private Action[] actions = new Action[] { - new ShortcutAction("Enter", ShortcutAction.KeyCode.ENTER, - new int[] {}), - new ShortcutAction("CTRL-S", ShortcutAction.KeyCode.S, - new int[] { ShortcutAction.ModifierKey.CTRL }), }; - - @Override - public Action[] getActions(Object target, Object sender) { - return actions; - } - - @Override - public void handleAction(Action action, Object sender, Object target) { - status.setValue("Pressed " + action.getCaption() - + " to fire shortcut. Texfield value: " + f.getValue()); - f.focus(); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1368.java b/uitest/src/com/vaadin/tests/tickets/Ticket1368.java deleted file mode 100644 index b2816480fc..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1368.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -/** - */ -public class Ticket1368 extends LegacyApplication { - - private Table t; - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow("Test app to #1368"); - setMainWindow(mainWin); - - t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 5); - - mainWin.addComponent(t); - - ComboBox addColumn = new ComboBox(); - addColumn.setImmediate(true); - addColumn.setNewItemsAllowed(true); - addColumn.setNewItemHandler(new ComboBox.NewItemHandler() { - @Override - public void addNewItem(String newItemCaption) { - t.addContainerProperty(newItemCaption, String.class, "-"); - } - }); - mainWin.addComponent(addColumn); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1397.java b/uitest/src/com/vaadin/tests/tickets/Ticket1397.java deleted file mode 100644 index 40ffd78740..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1397.java +++ /dev/null @@ -1,169 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; - -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.InlineDateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.PopupView; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1397 extends LegacyApplication { - - LegacyWindow main; - - @Override - public void init() { - setTheme("runo"); - main = new LegacyWindow("PopupView test"); - setMainWindow(main); - VerticalLayout panelLayout = new VerticalLayout(); - panelLayout.setMargin(true); - Panel panel = new Panel("PopupTest", panelLayout); - - // First test component - final ObjectProperty<String> prop = new ObjectProperty<String>( - "fooTextField"); - - PopupView.Content content = new PopupView.Content() { - @Override - public String getMinimizedValueAsHTML() { - return String.valueOf(prop.getValue()); - } - - @Override - public Component getPopupComponent() { - return new TextField("Edit foo", prop); - } - }; - - PopupView pe = new PopupView(content); - pe.setDescription("Click to edit"); - panelLayout.addComponent(pe); - - // Second test component - PopupView pe2 = new PopupView("fooLabel", new Label("Foooooooooo...")); - pe2.setDescription("Click to view"); - panelLayout.addComponent(pe2); - - // Third test component - final ObjectProperty<StringBuffer> prop2 = new ObjectProperty<StringBuffer>( - new StringBuffer("Text for button")); - - class myButton extends Button { - public myButton() { - super("Reverse the property"); - this.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - StringBuffer getContents = prop2.getValue(); - getContents.reverse(); - - } - }); - } - } - - VerticalLayout panel2Layout = new VerticalLayout(); - panel2Layout.setMargin(true); - final Panel panel2 = new Panel("Editor with a button", panel2Layout); - panel2Layout.addComponent(new myButton()); - PopupView.Content content2 = new PopupView.Content() { - @Override - public String getMinimizedValueAsHTML() { - return String.valueOf(prop2.getValue()); - } - - @Override - public Component getPopupComponent() { - return panel2; - } - }; - - PopupView p3 = new PopupView(content2); - panelLayout.addComponent(p3); - - // Fourth test component - VerticalLayout panel3Layout = new VerticalLayout(); - panel3Layout.setMargin(true); - final Panel panel3 = new Panel("Editor popup for a property", - panel3Layout); - TextField tf2 = new TextField("TextField for editing a property"); - final ObjectProperty<String> op = new ObjectProperty<String>( - "This is property text."); - tf2.setPropertyDataSource(op); - panel3Layout.addComponent(tf2); - PopupView.Content content3 = new PopupView.Content() { - - @Override - public String getMinimizedValueAsHTML() { - return String.valueOf(op.getValue()); - } - - @Override - public Component getPopupComponent() { - return panel3; - } - - }; - PopupView p4 = new PopupView(content3); - panelLayout.addComponent(p4); - - // Fifth test component - Table table = new Table("Table for testing purposes"); - for (int i = 0; i < 5; i++) { - table.addContainerProperty("" + (i + 1), String.class, ""); - } - table.addContainerProperty("" + 6, PopupView.class, null); - table.addContainerProperty("" + 7, PopupView.class, null); - table.setPageLength(20); - for (int i = 0; i < 1000; i++) { - - final InlineDateField df = new InlineDateField("", new Date()); - PopupView pp = new PopupView(new PopupView.Content() { - @Override - public String getMinimizedValueAsHTML() { - return String.valueOf(df.getValue()); - } - - @Override - public Component getPopupComponent() { - return df; - } - }); - final int lineNum = i; - PopupView pp2 = new PopupView(new PopupView.Content() { - - TextField tf = new TextField("Editor for line " + lineNum, - - "Try to edit the contents for this textfield on line " - + lineNum - + " and see how the overview-version changes."); - - @Override - public String getMinimizedValueAsHTML() { - return "" + String.valueOf(tf.getValue()).length() - + " characters of info"; - } - - @Override - public Component getPopupComponent() { - return tf; - } - - }); - table.addItem(new Object[] { "1 " + i, "2 " + i, "3 " + i, - "4 " + i, "5 " + i, pp, pp2 }, new Integer(i)); - } - - main.addComponent(table); - main.addComponent(panel); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1435.java b/uitest/src/com/vaadin/tests/tickets/Ticket1435.java deleted file mode 100644 index 9c8f400e1d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1435.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1435 extends LegacyApplication { - - private static final boolean useWorkaround = true; - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow( - "ButtonPanel containing a table test"); - setMainWindow(mainWin); - ((AbstractOrderedLayout) mainWin.getContent()).setSpacing(true); - - ButtonPanel dataCardView1 = buildButtonPanel("My Tickets"); - ButtonPanel dataCardView2 = buildButtonPanel("My Tickets 2"); - - mainWin.addComponent(dataCardView1); - mainWin.addComponent(dataCardView2); - - } - - /** - * A ButtonPanel is a Panel, which has context specific Buttons in its - * header. - * - * ButtonPanel also provides buttons for controlling its visibility - * (collapse/expand). - */ - public class ButtonPanel extends CustomComponent { - - VerticalLayout root = new VerticalLayout(); - - // In header are the panel's title and the control buttons. - // Panel title is expanded by default. - HorizontalLayout header = new HorizontalLayout(); - - // This is where the actual data is put. - VerticalLayout containerLayout = new VerticalLayout(); - Panel container = new Panel(containerLayout); - - // Last known height before the panel was collapsed - private float lastHeight = -1; - private Unit lastHeightUnit = null; - - public ButtonPanel(String labelString) { - setCompositionRoot(root); - root.setSizeFull(); - - root.setStyleName("toolbarpanel"); - header.setStyleName("toolbar"); - - initHeader(labelString); - - containerLayout.setMargin(true); - - initContainer(); - } - - private void initHeader(String labelString) { - root.addComponent(header); - header.setWidth("100%"); - header.setHeight("26px"); - Label label = new Label(labelString); - label.setStyleName("caption"); - header.addComponent(label); - - final Layout buttonContainer; - if (useWorkaround) { - buttonContainer = header; - - } else { - buttonContainer = new HorizontalLayout(); - header.addComponent(buttonContainer); - - } - - Button edit = new Button("Edit"); - edit.setStyleName("link"); - buttonContainer.addComponent(edit); - - Button copy = new Button("Copy"); - copy.setStyleName("link"); - buttonContainer.addComponent(copy); - - Button move = new Button("Move"); - move.setStyleName("link"); - buttonContainer.addComponent(move); - - Button delete = new Button("Delete"); - delete.setStyleName("link"); - buttonContainer.addComponent(delete); - - Button bind = new Button("Bind"); - bind.setStyleName("link"); - buttonContainer.addComponent(bind); - - Button options = new Button("Options..."); - options.setStyleName("link"); - buttonContainer.addComponent(options); - - final Button expand = new Button("Expand"); - - final Button collapse = new Button("Collapse"); - buttonContainer.addComponent(collapse); - - collapse.setStyleName("collapse"); - collapse.addClickListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - if (useWorkaround) { - container.setVisible(false); - lastHeight = root.getHeight(); - lastHeightUnit = root.getHeightUnits(); - root.setHeight("26px"); - buttonContainer.replaceComponent(collapse, expand); - } else { - boolean visible = container.isVisible(); - container.setVisible(!visible); - if (visible) { - lastHeight = root.getHeight(); - lastHeightUnit = root.getHeightUnits(); - root.setHeight("26px"); - } else { - root.setHeight(lastHeight, lastHeightUnit); - } - event.getButton().setCaption( - visible ? "Expand" : "Collapse"); - } - } - }); - - if (useWorkaround) { - expand.addClickListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - container.setVisible(true); - root.setHeight(lastHeight, lastHeightUnit); - buttonContainer.replaceComponent(expand, collapse); - } - }); - } - - } - - private void initContainer() { - container.setStyleName("custompanel"); - container.setSizeFull(); - containerLayout.setMargin(false); - containerLayout.setSizeFull(); - root.addComponent(container); - root.setExpandRatio(container, 1); - } - - public void setHeight(int height, Unit unit) { - root.setHeight(height, unit); - lastHeight = height; - lastHeightUnit = unit; - container.setHeight("100%"); - } - - @Override - public void setHeight(String height) { - root.setHeight(height); - lastHeight = root.getHeight(); - lastHeightUnit = root.getHeightUnits(); - container.setHeight("100%"); - } - - @Override - public void setWidth(String width) { - root.setWidth(width); - } - - public void setWidth(int width, Unit unit) { - root.setWidth(width, unit); - } - - @Override - public void setSizeFull() { - setWidth("100%"); - setHeight("100%"); - } - - public void setPanelComponent(Component component) { - containerLayout.removeAllComponents(); - containerLayout.addComponent(component); - } - } - - public ButtonPanel buildButtonPanel(String caption) { - ButtonPanel panel = new ButtonPanel(caption); - - panel.setHeight("250px"); - panel.setWidth("500px"); - - Table table = new Table(); - - table.setSizeFull(); - - table.addContainerProperty("checkbox", CheckBox.class, new CheckBox()); - table.setColumnWidth("checkbox", 30); - table.setColumnHeader("checkbox", ""); - - table.addContainerProperty("Tickets", String.class, null); - table.setColumnWidth("Tickets", 150); - - table.addContainerProperty("Deadline", String.class, null); - - for (int i = 0; i < 10; i++) { - String name = "Name " + i; - table.addItem(new Object[] { new CheckBox(), name, - "02-22-2007 13:37" }, new Integer(i)); - } - - panel.setPanelComponent(table); - - return panel; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1444.java b/uitest/src/com/vaadin/tests/tickets/Ticket1444.java deleted file mode 100644 index c786d8aab8..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1444.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1444 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow( - "Test app to break layout fuction in IE7"); - setMainWindow(mainWin); - - VerticalLayout ol = new VerticalLayout(); - ol.setHeight("250px"); - ol.setWidth("500px"); - - Label red = new Label( - "<div style='background:red;width:100%;height:100%;'>??</div>", - ContentMode.HTML); - red.setSizeFull(); - - ol.addComponent(red); - mainWin.addComponent(ol); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java deleted file mode 100644 index 005beab7c4..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Notification; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket1465ModalNotification extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow( - "ButtonPanel containing a table test"); - setMainWindow(mainWin); - - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - final Window modal = new Window("Modal window", layout); - modal.setModal(true); - - Button b = new Button("click to show notification", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Notification.show( - "Try clicking the button in main window!", - Notification.TYPE_ERROR_MESSAGE); - - } - }); - layout.addComponent(b); - - b = new Button("click to warning notification", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Notification.show( - "Try clicking the button in main window!", - Notification.TYPE_WARNING_MESSAGE); - } - }); - layout.addComponent(b); - - b = new Button("click to Humanized notification", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Notification.show( - "Try clicking the button in main window!", - Notification.TYPE_HUMANIZED_MESSAGE); - } - }); - layout.addComponent(b); - - b = new Button("click to test modality!", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - mainWin.addComponent(new Label("clicked")); - - } - }); - - layout.addComponent(b); - - mainWin.addWindow(modal); - - b = new Button("click to test modality!", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - mainWin.addComponent(new Label("clicked")); - - } - }); - - mainWin.addComponent(b); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506.java deleted file mode 100644 index 4788d27aad..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1506.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Panel; - -public class Ticket1506 extends CustomComponent { - - Panel p; - - public Ticket1506() { - p = new Ticket1506_Panel(); - setCompositionRoot(p); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_Panel.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_Panel.java deleted file mode 100644 index b59b7f8e5e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1506_Panel.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Container; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.shared.ui.combobox.FilteringMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; -import com.vaadin.ui.VerticalLayout; - -/** - * @author Efecte R&D - * @version $Revision$, $Date$ - */ -public class Ticket1506_Panel extends Panel { - - public Ticket1506_Panel() { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - setContent(layout); - - ObjectProperty<String> property1 = new ObjectProperty<String>(null, - String.class); - layout.addComponent(initSelect(new Ticket1506_TestContainer(), - "Test select", property1)); - layout.addComponent(initButton(property1)); - layout.addComponent(initSelect(new Ticket1506_TestContainer2(), - "Test select 2", new ObjectProperty<String>(null, String.class))); - } - - private Component initButton(final ObjectProperty<?> property) { - Button button = new Button("Clear select"); - button.addClickListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - property.setValue(null); - } - }); - return button; - } - - private Component initSelect(Container containerDataSource, String caption, - ObjectProperty<?> property) { - Select select = new Select(caption); - select.setFilteringMode(FilteringMode.CONTAINS); - select.setImmediate(true); - select.setNullSelectionAllowed(false); - select.setItemCaptionPropertyId(Ticket1506_TestContainer.PROPERTY_2_ID); - - select.setContainerDataSource(containerDataSource); - select.setPropertyDataSource(property); - return select; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java deleted file mode 100644 index d6b53db7c7..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.data.util.PropertysetItem; - -/** - * @author Efecte R&D - * @version $Revision$, $Date$ - */ -public class Ticket1506_TestContainer implements Container { - private Map<String, PropertysetItem> items = new HashMap<String, PropertysetItem>(); - public static final String ITEM_1_ID = "1"; - public static final String ITEM_2_ID = "2"; - public static final String PROPERTY_1_ID = "property 1"; - public static final String PROPERTY_2_ID = "property 2"; - - private void loadItems() { - final PropertysetItem item1 = new PropertysetItem(); - item1.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>( - "value 1", String.class)); - item1.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>( - "name 1", String.class)); - items.put(ITEM_1_ID, item1); - - final PropertysetItem item2 = new PropertysetItem(); - item2.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>( - "value 2", String.class)); - item2.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>( - "name 2", String.class)); - items.put(ITEM_2_ID, item2); - } - - @Override - public Item getItem(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return items.get(itemId); - } - - @Override - public Collection<String> getContainerPropertyIds() { - if (items.isEmpty()) { - loadItems(); - } - ArrayList<String> a = new ArrayList<String>(); - a.add(PROPERTY_1_ID); - a.add(PROPERTY_2_ID); - return a; - } - - @Override - public Collection<String> getItemIds() { - if (items.isEmpty()) { - loadItems(); - } - ArrayList<String> a = new ArrayList<String>(); - a.add(ITEM_1_ID); - a.add(ITEM_2_ID); - return a; - } - - @Override - public Property<?> getContainerProperty(Object itemId, Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - Item item = items.get(itemId); - if (item != null) { - return item.getItemProperty(propertyId); - } - return null; - } - - @Override - public Class<String> getType(Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - return String.class; - } - - @Override - public int size() { - if (items.isEmpty()) { - loadItems(); - } - return items.size(); - } - - @Override - public boolean containsId(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return items.containsKey(itemId); - } - - @Override - public Item addItem(Object itemId) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public Object addItem() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean removeItem(Object itemId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean addContainerProperty(Object propertyId, Class<?> type, - Object defaultValue) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean removeAllItems() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java deleted file mode 100644 index 288a9ef7d2..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.data.util.PropertysetItem; - -/** - * @author Efecte R&D - * @version $Revision$, $Date$ - */ -public class Ticket1506_TestContainer2 implements Container { - private Map<String, PropertysetItem> items = new HashMap<String, PropertysetItem>(); - public static final String ITEM_1_ID = "1"; - public static final String ITEM_2_ID = "2"; - public static final String PROPERTY_1_ID = "property 1"; - public static final String PROPERTY_2_ID = "property 2"; - - private void loadItems() { - for (int i = 1; i < 15; i++) { - final PropertysetItem item = new PropertysetItem(); - item.addItemProperty(PROPERTY_1_ID, new ObjectProperty<String>( - "value " + i, String.class)); - item.addItemProperty(PROPERTY_2_ID, new ObjectProperty<String>( - "name " + i, String.class)); - items.put(String.valueOf(i), item); - } - } - - @Override - public Item getItem(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return items.get(itemId); - } - - @Override - public Collection<String> getContainerPropertyIds() { - if (items.isEmpty()) { - loadItems(); - } - ArrayList<String> a = new ArrayList<String>(); - a.add(PROPERTY_1_ID); - a.add(PROPERTY_2_ID); - return a; - } - - @Override - public Collection<String> getItemIds() { - if (items.isEmpty()) { - loadItems(); - } - return items.keySet(); - } - - @Override - public Property<?> getContainerProperty(Object itemId, Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - Item item = items.get(itemId); - if (item != null) { - return item.getItemProperty(propertyId); - } - return null; - } - - @Override - public Class<String> getType(Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - return String.class; - } - - @Override - public int size() { - if (items.isEmpty()) { - loadItems(); - } - return items.size(); - } - - @Override - public boolean containsId(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return items.containsKey(itemId); - } - - @Override - public Item addItem(Object itemId) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public Object addItem() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean removeItem(Object itemId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean addContainerProperty(Object propertyId, Class<?> type, - Object defaultValue) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - @Override - public boolean removeAllItems() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1519.java b/uitest/src/com/vaadin/tests/tickets/Ticket1519.java deleted file mode 100644 index c603e996ca..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1519.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; - -public class Ticket1519 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow("Test app to #1519"); - setMainWindow(mainWin); - - setTheme("tests-tickets"); - TabSheet ts = new TabSheet(); - - ts.addTab(new CustomLayout("Ticket1519_News"), "News", null); - ts.addTab(new CustomLayout("Ticket1519_Support"), "Support", null); - - mainWin.addComponent(ts); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1572.java b/uitest/src/com/vaadin/tests/tickets/Ticket1572.java deleted file mode 100644 index 5233a9dd6f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1572.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.shared.ui.MarginInfo; -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.LegacyWindow; -import com.vaadin.ui.Panel; - -public class Ticket1572 extends com.vaadin.server.LegacyApplication { - - private Label state; - private GridLayout gl; - private Label spacingstate; - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - HorizontalLayout pl = new HorizontalLayout(); - Panel p = new Panel("Test wrapper for gridlayout margin/spacing", pl); - - gl = new GridLayout(3, 3); - gl.setMargin(true); - for (int i = 0; i < 3 * 3; i++) { - gl.addComponent(new Button("test")); - } - pl.addComponent(gl); - pl.addComponent(new Label("| next component")); - - Button b = new Button("next margin state"); - b.addClickListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - nextMarginState(); - } - - }); - - state = new Label(); - state.setCaption("Current margin state:"); - main.addComponent(state); - main.addComponent(b); - - Button b2 = new Button("next spacing state"); - b2.addClickListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - nextSpacingState(); - } - - }); - - spacingstate = new Label(); - spacingstate.setCaption("Current Spacing State:"); - main.addComponent(spacingstate); - main.addComponent(b2); - - main.addComponent(p); - - nextMarginState(); - nextSpacingState(); - - } - - private int stateCounter = -1; - - private void nextMarginState() { - stateCounter++; - switch (stateCounter) { - case 0: - gl.setMargin(false); - state.setValue("Margin off"); - break; - case 1: - gl.setMargin(true); - state.setValue("Margin on"); - break; - case 2: - gl.setMargin(new MarginInfo(true, false, false, false)); - state.setValue("Margin top"); - break; - case 3: - gl.setMargin(new MarginInfo(false, true, false, false)); - state.setValue("Margin right"); - break; - case 4: - gl.setMargin(new MarginInfo(false, false, true, false)); - state.setValue("Margin bottom"); - break; - case 5: - gl.setMargin(new MarginInfo(false, false, false, true)); - state.setValue("Margin left"); - break; - default: - stateCounter = -1; - nextMarginState(); - break; - } - } - - private boolean spacing = true; - - private void nextSpacingState() { - spacing = !spacing; - if (spacing) { - gl.setSpacing(true); - spacingstate.setValue("Spacing on"); - } else { - gl.setSpacing(false); - spacingstate.setValue("Spacing off"); - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1581.java b/uitest/src/com/vaadin/tests/tickets/Ticket1581.java deleted file mode 100644 index 76673021bb..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1581.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.ProgressIndicator; - -public class Ticket1581 extends com.vaadin.server.LegacyApplication { - - private Label time; - private ProgressIndicator poller; - private Thread thread; - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.addComponent(new Label("Test the second issue in ticket #1581")); - - time = new Label(); - poller = new ProgressIndicator(); - poller.setPollingInterval(200); - main.addComponent(time); - main.addComponent(poller); - - thread = new Thread() { - - @Override - public void run() { - super.run(); - while (true) { - time.setValue(new Date().toString()); - try { - sleep(200); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - }; - - thread.start(); - - final Button stop = new Button("Stop updating", new ClickListener() { - boolean active = true; - - @Override - public void buttonClick(ClickEvent event) { - - if (active) { - main.removeComponent(poller); - event.getButton().setCaption("Resume"); - } else { - main.addComponent(poller); - event.getButton().setCaption("Stop updating"); - } - active = !active; - } - }); - - main.addComponent(stop); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java deleted file mode 100644 index 45ff15e456..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.util.Date; - -import javax.imageio.ImageIO; - -import com.vaadin.server.DownloadStream; -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.RequestHandler; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinSession; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Link; - -public class Ticket1589 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - MyDynamicResource res = new MyDynamicResource(); - - VaadinSession.getCurrent().addRequestHandler(res); - - w.addComponent(new Link( - "Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)", - new ExternalResource("myresource"))); - - w.addComponent(new Link( - "Test (with Content-Disposition, should popup download dialog that suggests filename downloadedPNG.png)", - new ExternalResource("myresource_download"))); - } -} - -class MyDynamicResource implements RequestHandler { - String textToDisplay = (new Date()).toString(); - - /** - * Provides the dynamic resource if the URI matches the resource URI. The - * matching URI is "/myresource" under the application URI context. - * - * Returns null if the URI does not match. Otherwise returns a download - * stream that contains the response from the server. - */ - @Override - public boolean handleRequest(VaadinSession session, VaadinRequest request, - VaadinResponse response) throws IOException { - String relativeUri = request.getPathInfo(); - // Catch the given URI that identifies the resource, otherwise let other - // URI handlers or the Application to handle the response. - if (!relativeUri.startsWith("myresource")) { - return false; - } - - // Create an image and draw some background on it. - BufferedImage image = new BufferedImage(200, 200, - BufferedImage.TYPE_INT_RGB); - Graphics drawable = image.getGraphics(); - drawable.setColor(Color.lightGray); - drawable.fillRect(0, 0, 200, 200); - drawable.setColor(Color.yellow); - drawable.fillOval(25, 25, 150, 150); - drawable.setColor(Color.blue); - drawable.drawRect(0, 0, 199, 199); - - // Use the parameter to create dynamic content. - drawable.setColor(Color.black); - drawable.drawString("Time: " + textToDisplay, 75, 100); - - try { - // Write the image to a buffer. - ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream(); - ImageIO.write(image, "png", imagebuffer); - - // Return a stream from the buffer. - ByteArrayInputStream istream = new ByteArrayInputStream( - imagebuffer.toByteArray()); - DownloadStream downloadStream = new DownloadStream(istream, - "image/png", "generatedFile.png"); - - if (relativeUri.startsWith("myresource_download")) { - downloadStream.setParameter("Content-Disposition", - "attachment; filename=\"downloadedPNG.png\""); - } - downloadStream.writeResponse(request, response); - return true; - } catch (IOException e) { - return false; - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1598.java b/uitest/src/com/vaadin/tests/tickets/Ticket1598.java deleted file mode 100644 index a890c08ddb..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1598.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.ThemeResource; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.MenuBar; -import com.vaadin.ui.MenuBar.Command; -import com.vaadin.ui.MenuBar.MenuItem; - -public class Ticket1598 extends LegacyApplication { - - LegacyWindow main = new LegacyWindow("MenuBar test"); - - final MenuBar menuBar = new MenuBar(); - - @Override - public void init() { - setMainWindow(main); - setTheme("runo"); - - List<MenuItem> itemList = new ArrayList<MenuItem>(); - // Populate the menu bar - for (int i = 0; i < 6; i++) { - itemList.add(menuBar.addItem(new String("Menu " + i), null, null)); - } - - MenuItem first = itemList.get(0); - - for (int i = 0; i < 5; i++) { - first.addItem(new String("Submenu item" + i), null, new Command() { - - @Override - public void menuSelected(MenuItem selected) { - main.showNotification("Action " + selected.getText()); - } - }); - } - - MenuItem firstSubItem1 = first.getChildren().get(1); - - for (int i = 0; i < 3; i++) { - firstSubItem1.addItem(new String("Subsubmenu item" + i), null, - new Command() { - - @Override - public void menuSelected(MenuItem selected) { - main.showNotification("Action " - + selected.getText()); - } - }); - } - MenuItem firstSubItem2 = first.getChildren().get(3); - - for (int i = 0; i < 3; i++) { - firstSubItem2.addItem(new String("Subsubmenu item" + i), null, - new Command() { - - @Override - public void menuSelected(MenuItem selected) { - main.showNotification("Action " - + selected.getText()); - } - }); - } - - MenuItem second = menuBar.getItems().get(1); - - for (int i = 0; i < 5; i++) { - second.addItem(new String("Second submenu item" + i), null, - new Command() { - - @Override - public void menuSelected(MenuItem selected) { - main.showNotification("Action " - + selected.getText()); - } - }); - } - - MenuItem third = menuBar.getItems().get(2); - third.setIcon(new ThemeResource("icons/16/document.png")); - - for (int i = 2; i <= 3; i++) { - (menuBar.getItems().get(i)).setCommand(new Command() { - - @Override - public void menuSelected(MenuItem selectedItem) { - main.showNotification("Action " + selectedItem.getText()); - } - }); - } - - final MenuItem fourth = menuBar.getItems().get(3); - fourth.setText("Add new item"); - - fourth.setCommand(new Command() { - @Override - public void menuSelected(MenuItem selected) { - menuBar.addItem("Newborn", null, null); - } - }); - - final MenuItem fifth = menuBar.getItems().get(4); - for (int i = 0; i < 5; i++) { - fifth.addItem("Another subitem " + i, null); - } - - final MenuItem last = menuBar.getItems().get(menuBar.getSize() - 1); - last.setText("Remove me!"); - - // A command for removing the selected menuitem - Command removeCommand = new Command() { - - @Override - public void menuSelected(MenuItem selected) { - MenuItem parent = selected.getParent(); - if (parent != null) { - parent.removeChild(selected); - } else { - menuBar.removeItem(selected); - } - } - }; - - last.setCommand(removeCommand); - - main.addComponent(menuBar); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket161.java b/uitest/src/com/vaadin/tests/tickets/Ticket161.java deleted file mode 100644 index 988128f4af..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket161.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Container; -import com.vaadin.server.LegacyApplication; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -/** - */ -public class Ticket161 extends LegacyApplication { - - private Table t; - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow("Test app to #1368"); - setMainWindow(mainWin); - - t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 100); - t.setCurrentPageFirstItemIndex(50); - - mainWin.addComponent(t); - - Button b = new Button("Truncate to 20 rows"); - b.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - - Container containerDataSource = t.getContainerDataSource(); - Object[] itemIds = containerDataSource.getItemIds().toArray(); - @SuppressWarnings("unused") - int c = 0; - for (int i = 0; i < itemIds.length; i++) { - if (i > 19) { - containerDataSource.removeItem(itemIds[i]); - } - } - } - }); - - mainWin.addComponent(b); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java deleted file mode 100644 index c227bcc3d8..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -/** - */ -public class Ticket1632 extends LegacyApplication { - - private Table t; - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow("Test app"); - setMainWindow(mainWin); - - t = new Table(); - - t.addContainerProperty("col1", String.class, ""); - t.addContainerProperty("col2", String.class, ""); - t.addContainerProperty("col3", String.class, ""); - - t.addItem(new Object[] { "jep", "foo", "bar" }, "1"); - t.addItem(new Object[] { "jep", "foo", "bar" }, "2"); - t.addItem(new Object[] { "jep", "foo", "bar" }, "3"); - - t.setVisibleColumns(new Object[] { "col1", "col2" }); - - t.addItem(new Object[] { "foo", "bar" }, "4"); - - // workaround to add item with all values - Item i = t.addItem("5"); - i.getItemProperty("col1").setValue("jep"); - i.getItemProperty("col2").setValue("foo"); - i.getItemProperty("col3").setValue("bar"); - - mainWin.addComponent(t); - - Button b = new Button("Toggle col3"); - b.addListener(new Button.ClickListener() { - boolean visible = false; - - @Override - public void buttonClick(ClickEvent event) { - visible = !visible; - if (visible) { - t.setVisibleColumns(new Object[] { "col1", "col2", "col3" }); - - } else { - t.setVisibleColumns(new Object[] { "col1", "col2" }); - - } - - } - }); - - mainWin.addComponent(b); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1659.java b/uitest/src/com/vaadin/tests/tickets/Ticket1659.java deleted file mode 100644 index 826a5539d8..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1659.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1659 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow mainWin = new LegacyWindow(); - setMainWindow(mainWin); - mainWin.addComponent(new Button( - "Change URI using Application.getURL()", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - mainWin.open(new ExternalResource(getURL() + "#" - + System.currentTimeMillis())); - } - })); - mainWin.addComponent(new Button("Change URI uring Window.getURL()", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - mainWin.open(new ExternalResource(mainWin.getURL() - + "#" + System.currentTimeMillis())); - } - })); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1663.java b/uitest/src/com/vaadin/tests/tickets/Ticket1663.java deleted file mode 100644 index 684e14ed2a..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1663.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.SystemError; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1663 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - LegacyWindow main = new LegacyWindow("#1663"); - setMainWindow(main); - - TextField tf = new TextField("First name"); - tf.setDescription("The first name is used for the administration user interfaces only."); - tf.setComponentError(new SystemError( - "You must enter only one first name.")); - - main.addComponent(tf); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1673.java b/uitest/src/com/vaadin/tests/tickets/Ticket1673.java deleted file mode 100644 index 7d2e7b7271..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1673.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.CustomizedSystemMessages; -import com.vaadin.server.SystemMessages; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1673 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow("#1673"); - setMainWindow(main); - - main.addComponent(new Button("close", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - close(); - } - })); - - } - - public static SystemMessages getSystemMessages() { - CustomizedSystemMessages msgs = new CustomizedSystemMessages(); - - msgs.setSessionExpiredURL("http://www.vaadin.com/"); - msgs.setSessionExpiredCaption("Foo"); - msgs.setSessionExpiredMessage("Bar"); - - return msgs; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1710.java b/uitest/src/com/vaadin/tests/tickets/Ticket1710.java deleted file mode 100644 index 3dda830607..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1710.java +++ /dev/null @@ -1,411 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.server.SystemError; -import com.vaadin.server.ThemeResource; -import com.vaadin.shared.ui.AlignmentInfo.Bits; -import com.vaadin.shared.ui.MarginInfo; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Form; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Layout.AlignmentHandler; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1710 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - setTheme("tests-tickets"); - - VerticalLayout lo = new VerticalLayout(); - setMainWindow(new LegacyWindow("#1710", lo)); - lo.setMargin(true); - lo.setSpacing(true); - lo.setWidth("100%"); - - // Hiding controls - HorizontalLayout hidingControls = new HorizontalLayout(); - lo.addComponent(hidingControls); - - // OrderedLayout - final VerticalLayout orderedLayout = new VerticalLayout(); - LayoutTestingPanel oltp = new LayoutTestingPanel("OrderedLayout", - orderedLayout); - CheckBox cb = new CheckBox("OrderedLayout", - new MethodProperty<Boolean>(oltp, "visible")); - cb.setImmediate(true); - hidingControls.addComponent(cb); - lo.addComponent(oltp); - orderedLayout.setSpacing(false); - addFields(orderedLayout); - - // GridLayout - GridLayout grid = new GridLayout(1, 1); - Panel g1tp = new LayoutTestingPanel("Gridlayout with 1 column", grid); - cb = new CheckBox("GridLayout (1col)", new MethodProperty<Boolean>( - g1tp, "visible")); - cb.setImmediate(true); - hidingControls.addComponent(cb); - g1tp.setVisible(false); - lo.addComponent(g1tp); - grid.setSpacing(true); - addFields(grid); - GridLayout grid2 = new GridLayout(2, 1); - Panel g2tp = new LayoutTestingPanel("Gridlayout with 2 columns", grid2); - cb = new CheckBox("GridLayout (2cols)", new MethodProperty<Boolean>( - g2tp, "visible")); - cb.setImmediate(true); - hidingControls.addComponent(cb); - g2tp.setVisible(false); - lo.addComponent(g2tp); - grid2.setSpacing(true); - addFields(grid2); - - // ExpandLayout - VerticalLayout el = new VerticalLayout(); - Panel elp = new LayoutTestingPanel( - "ExpandLayout width first component expanded", el); - cb = new CheckBox("ExpandLayout (vertical)", - new MethodProperty<Boolean>(elp, "visible")); - cb.setImmediate(true); - hidingControls.addComponent(cb); - elp.setVisible(false); - el.setHeight("700px"); - addFields(el); - Component firstComponent = el.getComponentIterator().next(); - firstComponent.setSizeFull(); - el.setExpandRatio(firstComponent, 1); - lo.addComponent(elp); - HorizontalLayout elh = new HorizontalLayout(); - Panel elhp = new LayoutTestingPanel( - "ExpandLayout width first component expanded; horizontal", elh); - cb = new CheckBox("ExpandLayout (horizontal)", - new MethodProperty<Boolean>(elhp, "visible")); - cb.setImmediate(true); - hidingControls.addComponent(cb); - elhp.setVisible(false); - elh.setWidth("2000px"); - elh.setHeight("100px"); - addFields(elh); - Component firstComponentElh = elh.getComponentIterator().next(); - firstComponentElh.setSizeFull(); - elh.setExpandRatio(firstComponentElh, 1); - lo.addComponent(elhp); - - // CustomLayout - VerticalLayout cl = new VerticalLayout(); - Panel clp = new LayoutTestingPanel("CustomLayout", cl); - cb = new CheckBox("CustomLayout", new MethodProperty<Boolean>(clp, - "visible")); - cb.setImmediate(true); - hidingControls.addComponent(cb); - clp.setVisible(false); - lo.addComponent(clp); - cl.addComponent(new Label("<<< Add customlayout testcase here >>>")); - - // Form - VerticalLayout formPanelLayout = new VerticalLayout(); - formPanelLayout.setMargin(true); - Panel formPanel = new Panel("Form", formPanelLayout); - cb = new CheckBox("Form", new MethodProperty<Boolean>(formPanel, - "visible")); - cb.setImmediate(true); - hidingControls.addComponent(cb); - formPanel.setVisible(false); - formPanelLayout.addComponent(getFormPanelExample()); - lo.addComponent(formPanel); - - for (Iterator<Component> i = hidingControls.getComponentIterator(); i - .hasNext();) { - ((AbstractComponent) i.next()).setImmediate(true); - } - - } - - private Form getFormPanelExample() { - Form f = new Form(); - f.setCaption("Test form"); - CheckBox fb2 = new CheckBox("Test button", true); - fb2.setComponentError(new SystemError("Test error")); - f.addField("fb2", fb2); - TextField ft1 = new TextField("With caption"); - ft1.setComponentError(new SystemError("Error")); - f.addField("ft1", ft1); - TextField ft2 = new TextField(); - ft2.setComponentError(new SystemError("Error")); - ft2.setValue("Without caption"); - f.addField("ft2", ft2); - TextField ft3 = new TextField("With caption and required"); - ft3.setComponentError(new SystemError("Error")); - ft3.setRequired(true); - f.addField("ft3", ft3); - return f; - } - - private void addFields(ComponentContainer lo) { - Button button = new Button("Test button"); - button.setComponentError(new SystemError("Test error")); - lo.addComponent(button); - - CheckBox b2 = new CheckBox("Test button"); - b2.setComponentError(new SystemError("Test error")); - lo.addComponent(b2); - - TextField t1 = new TextField("With caption"); - t1.setComponentError(new SystemError("Error")); - lo.addComponent(t1); - - TextField t2 = new TextField("With caption and required"); - t2.setComponentError(new SystemError("Error")); - t2.setRequired(true); - lo.addComponent(t2); - - TextField t3 = new TextField(); - t3.setValue("Without caption"); - t3.setComponentError(new SystemError("Error")); - lo.addComponent(t3); - - lo.addComponent(new TextField("Textfield with no error in it")); - - TextField tt1 = new TextField("100% wide Textfield with no error in it"); - tt1.setWidth("100%"); - lo.addComponent(tt1); - - TextField tt2 = new TextField(); - tt2.setWidth("100%"); - tt2.setValue("100% wide Textfield with no error in it and no caption"); - lo.addComponent(tt2); - - TextField t4 = new TextField(); - t4.setValue("Without caption, With required"); - t4.setComponentError(new SystemError("Error")); - t4.setRequired(true); - lo.addComponent(t4); - - TextField t5 = new TextField(); - t5.setValue("Without caption, WIDE"); - t5.setComponentError(new SystemError("Error")); - t5.setWidth("100%"); - lo.addComponent(t5); - - TextField t6 = new TextField(); - t6.setValue("Without caption, With required, WIDE"); - t6.setComponentError(new SystemError("Error")); - t6.setRequired(true); - t6.setWidth("100%"); - lo.addComponent(t6); - - TextField t7 = new TextField(); - t7.setValue("With icon and required and icon"); - t7.setComponentError(new SystemError("Error")); - t7.setRequired(true); - t7.setIcon(new ThemeResource("../runo/icons/16/ok.png")); - lo.addComponent(t7); - - DateField d1 = new DateField( - "Datefield with caption and icon, next one without caption"); - d1.setComponentError(new SystemError("Error")); - d1.setRequired(true); - d1.setIcon(new ThemeResource("../runo/icons/16/ok.png")); - lo.addComponent(d1); - - DateField d2 = new DateField(); - d2.setComponentError(new SystemError("Error")); - d2.setRequired(true); - lo.addComponent(d2); - } - - public class LayoutTestingPanel extends Panel { - - Layout testedLayout; - - HorizontalLayout controls = new HorizontalLayout(); - CheckBox marginLeft = new CheckBox("m-left", false); - CheckBox marginRight = new CheckBox("m-right", false); - CheckBox marginTop = new CheckBox("m-top", false); - CheckBox marginBottom = new CheckBox("m-bottom", false); - CheckBox spacing = new CheckBox("spacing", false); - VerticalLayout testPanelLayout = new VerticalLayout(); - - LayoutTestingPanel(String caption, Layout layout) { - super(caption); - VerticalLayout internalLayout = new VerticalLayout(); - internalLayout.setWidth("100%"); - setContent(internalLayout); - testedLayout = layout; - testPanelLayout.setWidth("100%"); - VerticalLayout controlWrapperLayout = new VerticalLayout(); - controlWrapperLayout.setMargin(true); - Panel controlWrapper = new Panel(controlWrapperLayout); - controlWrapperLayout.addComponent(controls); - controlWrapper.setWidth("100%"); - controlWrapper.setStyleName("controls"); - internalLayout.addComponent(controlWrapper); - Panel testPanel = new Panel(testPanelLayout); - testPanel.setStyleName("testarea"); - testPanelLayout.addComponent(testedLayout); - internalLayout.addComponent(testPanel); - internalLayout.setMargin(true); - internalLayout.setSpacing(true); - controls.setSpacing(true); - controls.setMargin(false); - controls.addComponent(new Label("width")); - controls.addComponent(new TextField(new MethodProperty<Float>( - testedLayout, "width"))); - CheckBox widthPercentsCheckBox = new CheckBox("%", - new MethodProperty<Boolean>(this, "widthPercents")); - widthPercentsCheckBox.setImmediate(true); - controls.addComponent(widthPercentsCheckBox); - controls.addComponent(new Label("height")); - controls.addComponent(new TextField(new MethodProperty<Float>( - testedLayout, "height"))); - CheckBox heightPercentsCheckBox = new CheckBox("%", - new MethodProperty<Boolean>(this, "heightPercents")); - heightPercentsCheckBox.setImmediate(true); - controls.addComponent(heightPercentsCheckBox); - controls.addComponent(marginLeft); - controls.addComponent(marginRight); - controls.addComponent(marginTop); - controls.addComponent(marginBottom); - if (testedLayout instanceof Layout.SpacingHandler) { - controls.addComponent(spacing); - } - - Property.ValueChangeListener marginSpacingListener = new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - updateMarginsAndSpacing(); - } - }; - - marginBottom.addListener(marginSpacingListener); - marginTop.addListener(marginSpacingListener); - marginLeft.addListener(marginSpacingListener); - marginRight.addListener(marginSpacingListener); - spacing.addListener(marginSpacingListener); - updateMarginsAndSpacing(); - - addAlignmentControls(); - - testedLayout.setStyleName("tested-layout"); - setStyleName("layout-testing-panel"); - - for (Iterator<Component> i = controls.getComponentIterator(); i - .hasNext();) { - ((AbstractComponent) i.next()).setImmediate(true); - } - } - - @SuppressWarnings("deprecation") - private void addAlignmentControls() { - if (!(testedLayout instanceof Layout.AlignmentHandler)) { - return; - } - @SuppressWarnings("unused") - final Layout.AlignmentHandler ah = (AlignmentHandler) testedLayout; - - final NativeSelect vAlign = new NativeSelect(); - final NativeSelect hAlign = new NativeSelect(); - controls.addComponent(new Label("component alignment")); - controls.addComponent(hAlign); - controls.addComponent(vAlign); - hAlign.setNullSelectionAllowed(false); - vAlign.setNullSelectionAllowed(false); - - vAlign.addItem(new Integer(Bits.ALIGNMENT_TOP)); - vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_TOP), "top"); - vAlign.addItem(new Integer(Bits.ALIGNMENT_VERTICAL_CENTER)); - vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_VERTICAL_CENTER), - "center"); - vAlign.addItem(new Integer(Bits.ALIGNMENT_BOTTOM)); - vAlign.setItemCaption(new Integer(Bits.ALIGNMENT_BOTTOM), "bottom"); - - hAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT)); - hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left"); - hAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER)); - hAlign.setItemCaption( - new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center"); - hAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT)); - hAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right"); - - Property.ValueChangeListener alignmentChangeListener = new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - Integer h = ((Integer) hAlign.getValue()).intValue(); - int v = ((Integer) vAlign.getValue()).intValue(); - - updateAlignments(new Alignment(h + v)); - } - - }; - - hAlign.setValue(new Integer(Bits.ALIGNMENT_LEFT)); - vAlign.addListener(alignmentChangeListener); - hAlign.addListener(alignmentChangeListener); - vAlign.setValue(new Integer(Bits.ALIGNMENT_TOP)); - - controls.addComponent(new Label("layout alignment")); - final NativeSelect lAlign = new NativeSelect(); - controls.addComponent(lAlign); - lAlign.setNullSelectionAllowed(false); - lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT)); - lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left"); - lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER)); - lAlign.setItemCaption( - new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center"); - lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT)); - lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right"); - - lAlign.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - testPanelLayout.setComponentAlignment( - testedLayout, - new Alignment(((Integer) lAlign.getValue()) - .intValue() + Bits.ALIGNMENT_TOP)); - } - }); - } - - private void updateAlignments(Alignment a) { - for (Iterator<Component> i = testedLayout.getComponentIterator(); i - .hasNext();) { - ((Layout.AlignmentHandler) testedLayout).setComponentAlignment( - i.next(), a); - } - } - - private void updateMarginsAndSpacing() { - if (testedLayout instanceof Layout.MarginHandler) { - ((Layout.MarginHandler) testedLayout).setMargin(new MarginInfo( - marginTop.getValue().booleanValue(), marginRight - .getValue().booleanValue(), marginBottom - .getValue().booleanValue(), marginLeft - .getValue().booleanValue())); - } - if (testedLayout instanceof Layout.SpacingHandler) { - ((Layout.SpacingHandler) testedLayout).setSpacing(spacing - .getValue().booleanValue()); - } - } - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1737.java b/uitest/src/com/vaadin/tests/tickets/Ticket1737.java deleted file mode 100644 index 33515bad87..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1737.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.ClassResource; -import com.vaadin.server.DownloadStream; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.Resource; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1737 extends LegacyApplication { - - Resource slowRes = new ClassResource(Ticket1737.class, "m-bullet-blue.gif") { - @Override - public DownloadStream getStream() { - try { - Thread.sleep(4000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return super.getStream(); - } - }; - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - VerticalLayout el = new VerticalLayout(); - main.setContent(el); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel("Test panel", pl); - p.setSizeFull(); - - pl.addComponent(new Label( - "Second component is embedded with a slow resource " - + "and thus should break layout if Embedded cannot" - + " request re-layout after load.")); - - Embedded em = new Embedded("TestEmbedded", slowRes); - - el.addComponent(p); - el.addComponent(em); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1767.java b/uitest/src/com/vaadin/tests/tickets/Ticket1767.java deleted file mode 100644 index 85e0758b73..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1767.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1767 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - ComboBox cb = new ComboBox(" '<' item is not seen in populist?"); - cb.addItem("Te<strong>st</strong> < jep >"); - cb.addItem("<"); - cb.addItem(">"); - - cb.addItem("< dsf"); - cb.addItem("> sdf"); - - cb.addItem("dsfs <"); - cb.addItem("sdfsd >"); - - main.addComponent(cb); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1772.java b/uitest/src/com/vaadin/tests/tickets/Ticket1772.java deleted file mode 100644 index 7dfc608dcc..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1772.java +++ /dev/null @@ -1,38 +0,0 @@ -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.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1772 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - Button b = new Button("Add content"); - main.addComponent(b); - - final GridLayout gridLayout = new GridLayout(2, 2); - main.addComponent(gridLayout); - - b.addListener(new Button.ClickListener() { - int counter = 0; - - @Override - public void buttonClick(ClickEvent event) { - - gridLayout - .addComponent(new TextField("Content " + (++counter))); - - } - }); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1775.java b/uitest/src/com/vaadin/tests/tickets/Ticket1775.java deleted file mode 100644 index c6f3e56af4..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1775.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1775 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow("#1775"); - setMainWindow(main); - setTheme("tests-tickets"); - String layoutName = "Ticket1775"; - final CustomLayout layout = new CustomLayout(layoutName); - - main.addComponent(layout); - - Button button2 = new Button("Populate content"); - main.addComponent(button2); - - final Button button = new Button("Change content"); - main.addComponent(button); - - button2.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Label mainComponent = new Label("Main"); - Label header = new Label("Header"); - final Label anotherComponent = new Label("another"); - layout.addComponent(mainComponent, "body"); - layout.addComponent(header, "loginUser"); - button.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - layout.addComponent(anotherComponent, "body"); - layout.removeComponent("loginUser"); - } - }); - - } - }); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1804.java b/uitest/src/com/vaadin/tests/tickets/Ticket1804.java deleted file mode 100644 index bf648b0d92..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1804.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.data.Validator; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.server.SystemError; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; - -public class Ticket1804 extends com.vaadin.server.LegacyApplication { - - LinkedList<Select> listOfAllFields = new LinkedList<Select>(); - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow("#1804"); - setMainWindow(main); - - com.vaadin.ui.Select s; - - s = new Select("Select with null selection allowed; required=true"); - s.setNullSelectionAllowed(true); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select("Select with null selection NOT allowed; required=true"); - s.setNullSelectionAllowed(false); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select("Testcase from the ticket #1804"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id")); - s.addValidator(new EmptyStringValidator( - "Selection required for test-field")); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select("Testcase from the ticket #1804, but without validator"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id")); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select( - "Testcase from the ticket #1804, but with required=false"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id")); - s.addValidator(new EmptyStringValidator( - "Selection required for test-field")); - listOfAllFields.add(s); - - s = new Select( - "Testcase from the ticket #1804, but without validator and with required=false"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id")); - listOfAllFields.add(s); - - s = new Select( - "Required=true, custom error message, null selection not allowed"); - s.setRequired(true); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty<String>(new TestPojo(), "id")); - s.setValue(null); - s.setComponentError(new SystemError("Test error message")); - listOfAllFields.add(s); - - for (Iterator<Select> i = listOfAllFields.iterator(); i.hasNext();) { - s = i.next(); - main.addComponent(s); - s.addItem("foo"); - s.addItem(""); - s.addItem("bar"); - if (s.isNullSelectionAllowed()) { - s.addItem("<null>"); - s.setNullSelectionItemId("<null>"); - } - s.setImmediate(true); - } - - Button checkValidity = new Button("Check validity of the fields"); - main.addComponent(checkValidity); - checkValidity.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - StringBuffer msg = new StringBuffer(); - for (Iterator<Select> i = listOfAllFields.iterator(); i - .hasNext();) { - AbstractField<?> af = i.next(); - msg.append("<h1>" + af.getCaption() + "</h1>\n"); - msg.append("Value=" + af.getValue() + "<br/>\n"); - if (af.isValid()) { - msg.append("VALID\n<hr/>"); - } else { - msg.append("INVALID<br/><i>" + af.getErrorMessage() - + "</i><hr/>"); - } - } - Window w = new Window("Status of the fields"); - w.setModal(true); - w.setHeight("80%"); - w.setContent(new Label(msg.toString(), ContentMode.HTML)); - main.addWindow(w); - } - }); - } - - public class TestPojo { - String id = ""; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - } - - /** Throws an exception when the string is empty or null. */ - static class EmptyStringValidator implements Validator { - - String msg; - - EmptyStringValidator(String msg) { - this.msg = msg; - } - - @Override - public void validate(Object value) throws InvalidValueException { - if (value == null || value.toString().length() == 0) { - throw new InvalidValueException(msg); - } - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1805.java b/uitest/src/com/vaadin/tests/tickets/Ticket1805.java deleted file mode 100644 index e07310487f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1805.java +++ /dev/null @@ -1,58 +0,0 @@ -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; -import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1805 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - ((MarginHandler) main.getContent()).setMargin(false); - - Label description = new Label( - "GridLayout with 100% (no height), is wanted to " - + "share all available width with columns " - + "relatively to their natural width. And it " - + "should still work with margins and spacings"); - main.addComponent(description); - - final GridLayout grid = new GridLayout(4, 1); - - final TextField size = new TextField("Grid width in css unit"); - size.addListener(new ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - String width = size.getValue().toString(); - if (width == null || width.equals("")) { - grid.setSizeUndefined(); - } else { - grid.setWidth(width); - } - } - }); - main.addComponent(size); - main.addComponent(new Button("set size")); - - grid.setMargin(true); - grid.setSpacing(true); - - grid.addComponent(new Label("WIDE")); - grid.addComponent(new Label("_I_")); - grid.addComponent(new Label("VEEEEEEEEEEERY_WIDE")); - Label label = new Label("|"); - grid.addComponent(label); - grid.setComponentAlignment(label, Alignment.TOP_RIGHT); - main.addComponent(grid); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1806.java b/uitest/src/com/vaadin/tests/tickets/Ticket1806.java deleted file mode 100644 index 60ea9528d3..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1806.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1806 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - final ObjectProperty<String> prop = new ObjectProperty<String>(""); - final TextField tf1 = new TextField( - "Buffered TextField bound to ObjectProperty"); - tf1.setBuffered(true); - tf1.setPropertyDataSource(prop); - main.addComponent(tf1); - main.addComponent(new Button( - "This button does nothing (but flushes queued variable changes)")); - main.addComponent(new Button("Commit the field to property", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - tf1.commit(); - } - })); - main.addComponent(new Button("Show property value", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - main.showNotification("'" + prop.getValue() + "'"); - } - })); - main.addComponent(new Button("Show field value", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - main.showNotification("'" + tf1.getValue() + "'"); - } - })); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1811.java b/uitest/src/com/vaadin/tests/tickets/Ticket1811.java deleted file mode 100644 index e8f23da3d1..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1811.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.data.Validator; -import com.vaadin.data.validator.StringLengthValidator; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1811 extends com.vaadin.server.LegacyApplication { - - LinkedList<TextField> listOfAllFields = new LinkedList<TextField>(); - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow("#1811"); - setMainWindow(main); - - Validator strLenValidator = new StringLengthValidator( - "String must be at least 3 chars long and non-null", 3, -1, - false); - - TextField tf1 = new TextField( - "Text field with default settings (required=false)"); - listOfAllFields.add(tf1); - - TextField tf2 = new TextField("Text field with required=true"); - tf2.setRequired(true); - listOfAllFields.add(tf2); - - TextField tf3 = new TextField( - "Text field with required=true and strlen >= 3"); - tf3.setRequired(true); - tf3.addValidator(strLenValidator); - listOfAllFields.add(tf3); - - TextField tf4 = new TextField( - "Text field with required=false (default) and strlen >= 3"); - tf4.addValidator(strLenValidator); - listOfAllFields.add(tf4); - - for (Iterator<TextField> i = listOfAllFields.iterator(); i.hasNext();) { - TextField tf = i.next(); - main.addComponent(tf); - tf.setImmediate(true); - } - - Button checkValidity = new Button("Check validity of the fields"); - main.addComponent(checkValidity); - checkValidity.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - StringBuffer msg = new StringBuffer(); - for (Iterator<TextField> i = listOfAllFields.iterator(); i - .hasNext();) { - TextField tf = i.next(); - msg.append("<h1>" + tf.getCaption() + "</h1>\n"); - if (tf.isValid()) { - msg.append("VALID\n<hr/>"); - } else { - msg.append("INVALID<br/><i>" + tf.getErrorMessage() - + "</i><hr/>"); - } - } - Window w = new Window("Status of the fields"); - w.setModal(true); - w.setContent(new Label(msg.toString(), ContentMode.HTML)); - main.addWindow(w); - } - }); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1819.java b/uitest/src/com/vaadin/tests/tickets/Ticket1819.java deleted file mode 100644 index b9a0060ce0..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1819.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; - -public class Ticket1819 extends com.vaadin.server.LegacyApplication { - - LinkedList<Select> listOfAllFields = new LinkedList<Select>(); - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow("#1819"); - setMainWindow(main); - - com.vaadin.ui.Select s; - - s = new Select("Select with null selection allowed"); - s.setNullSelectionAllowed(true); - listOfAllFields.add(s); - - s = new Select("Select with null selection NOT allowed"); - s.setNullSelectionAllowed(false); - listOfAllFields.add(s); - - for (Iterator<Select> i = listOfAllFields.iterator(); i.hasNext();) { - s = i.next(); - main.addComponent(s); - s.addItem("-null-"); - s.addItem(""); - s.addItem("foo"); - s.addItem("bar"); - s.setNullSelectionItemId("-null-"); - s.setImmediate(true); - } - - Button checkValidity = new Button("Check validity of the fields"); - main.addComponent(checkValidity); - checkValidity.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - StringBuffer msg = new StringBuffer(); - for (Iterator<Select> i = listOfAllFields.iterator(); i - .hasNext();) { - AbstractField<?> af = i.next(); - msg.append("<h1>" + af.getCaption() + "</h1>\n"); - msg.append("Value=" + af.getValue() + "<br/>\n"); - } - Window w = new Window("Status of the fields"); - w.setModal(true); - w.setContent(new Label(msg.toString(), ContentMode.HTML)); - main.addWindow(w); - } - }); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java deleted file mode 100644 index 60078daacd..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1834PanelScrolling extends - com.vaadin.server.LegacyApplication { - - private static final int ROWS = 50; - - private Label state = new Label("State"); - - private Panel p; - private VerticalLayout pl; - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - HorizontalLayout currentState = new HorizontalLayout(); - - currentState.addComponent(state); - Button b = new Button("update"); - currentState.addComponent(b); - b.addListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - state.setValue("ScrollTop: " + p.getScrollTop() - + " ScrollLeft: " + p.getScrollLeft()); - } - }); - main.addComponent(currentState); - - b = new Button("ScrollBy 50px"); - b.addListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - p.setScrollLeft(p.getScrollLeft() + 50); - p.setScrollTop(p.getScrollTop() + 50); - state.setValue("ScrollTop: " + p.getScrollTop() - + " ScrollLeft: " + p.getScrollLeft()); - } - }); - - main.addComponent(b); - - b = new Button("Add row"); - b.addListener(new ClickListener() { - int i = 0; - - @Override - public void buttonClick(ClickEvent event) { - pl.addComponent(new Label("new Row" + ++i)); - } - }); - - main.addComponent(b); - - b = new Button("Repaint Panel"); - b.addListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - p.markAsDirty(); - } - }); - - main.addComponent(b); - - pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("TestPanel", pl); - - for (int i = 0; i < ROWS; i++) { - pl.addComponent(new Label( - "Label" - + i - + ".................................................................................................................")); - } - - p.setHeight("300px"); - p.setWidth("250px"); - - p.setScrollTop(100); - p.setScrollLeft(100); - - main.addComponent(p); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1857.java b/uitest/src/com/vaadin/tests/tickets/Ticket1857.java deleted file mode 100644 index 5c6f45de87..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1857.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.event.Action; -import com.vaadin.event.Action.Handler; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1857 extends LegacyApplication implements Handler { - - @Override - public void init() { - - setTheme("tests-tickets"); - - VerticalLayout el = new VerticalLayout(); - LegacyWindow main = new LegacyWindow("Testcase for #1857", el); - setMainWindow(main); - el.setMargin(true); - el.setSpacing(true); - - final Table t = new Table(); - el.addComponent(t); - el.setExpandRatio(t, 1); - t.setSizeFull(); - addContentsToTable(t); - t.setStyleName("foo"); - - HorizontalLayout footer = new HorizontalLayout(); - el.addComponent(footer); - footer.setSpacing(true); - - final CheckBox actionHandlerEnabler = new CheckBox("Action handlers", - false); - footer.addComponent(actionHandlerEnabler); - actionHandlerEnabler.setImmediate(true); - actionHandlerEnabler.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - if (actionHandlerEnabler.getValue().booleanValue()) { - t.addActionHandler(Ticket1857.this); - } else { - t.removeActionHandler(Ticket1857.this); - } - } - }); - - final CheckBox cellStylesEnabler = new CheckBox("Cell styles", false); - footer.addComponent(cellStylesEnabler); - cellStylesEnabler.setImmediate(true); - cellStylesEnabler.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - if (cellStylesEnabler.getValue().booleanValue()) { - t.setCellStyleGenerator(new Table.CellStyleGenerator() { - @Override - public String getStyle(Table source, Object itemId, - Object propertyId) { - Object cell = t.getContainerProperty(itemId, - propertyId).getValue(); - if (!(cell instanceof Integer)) { - return null; - } - int age = ((Integer) cell).intValue(); - return age > 65 ? "old" : (age < 18 ? "young" - : null); - } - }); - } else { - t.setCellStyleGenerator(null); - } - } - }); - cellStylesEnabler.setValue(Boolean.TRUE); - - } - - private void addContentsToTable(Table t) { - - t.addContainerProperty("First name", String.class, ""); - t.addContainerProperty("Last name", String.class, ""); - t.addContainerProperty("Age", Integer.class, ""); - - String firstNames[] = { "Quentin", "Marc", "Peter", "David", "Mary", - "Jani", "Jane", "Brita" }; - String lastNames[] = { "Heiskanen", "Bjorn", "Torwalds", "Autere", - "Smith", "Lindström" }; - - for (int i = 0; i < 1000; i++) { - t.addItem(new Object[] { - firstNames[((int) (Math.random() * firstNames.length))], - lastNames[((int) (Math.random() * lastNames.length))], - new Integer((int) (Math.random() * 100) + 10) }, - new Integer(i)); - } - } - - private final Action removeAction = new Action("Remove"); - - @Override - public Action[] getActions(Object target, Object sender) { - return new Action[] { removeAction }; - } - - @Override - public void handleAction(Action action, Object sender, Object target) { - getMainWindow().showNotification("Removing row number:" + target); - ((Table) sender).removeItem(target); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1868.java b/uitest/src/com/vaadin/tests/tickets/Ticket1868.java deleted file mode 100644 index 8bbd8a8350..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1868.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1868 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - setMainWindow(new LegacyWindow("#1868")); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel( - "This is a really long caption for the panel, too long in fact!", - pl); - p.setWidth("300px"); - p.setHeight("300px"); - - getMainWindow().addComponent(p); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1869.java b/uitest/src/com/vaadin/tests/tickets/Ticket1869.java deleted file mode 100644 index 8f5c1ce633..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1869.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1869 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - - GridLayout lo = new GridLayout(2, 1); - setMainWindow(new LegacyWindow("#1869", lo)); - lo.setMargin(true); - lo.setSpacing(true); - - VerticalLayout el = new VerticalLayout(); - Panel elp = new Panel( - "Vertical ExpandLayout /w first component expanded", el); - el.setHeight("1000px"); - for (int i = 0; i < 3; i++) { - Button b = new Button("x"); - el.addComponent(b); - if (i == 0) { - b.setSizeFull(); - el.setExpandRatio(b, 1); - } - } - lo.addComponent(elp); - elp.setWidth("300px"); - elp.setHeight("300px"); - - HorizontalLayout elh = new HorizontalLayout(); - Panel elph = new Panel( - "Horizontal ExpandLayout /w first component expanded", elh); - elh.setWidth("1000px"); - for (int i = 0; i < 3; i++) { - Button b = new Button("x"); - elh.addComponent(b); - if (i == 0) { - b.setSizeFull(); - elh.setExpandRatio(b, 1); - } - } - lo.addComponent(elph); - elph.setWidth("300px"); - elph.setHeight("300px"); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1878.java b/uitest/src/com/vaadin/tests/tickets/Ticket1878.java deleted file mode 100644 index 6078320b61..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1878.java +++ /dev/null @@ -1,388 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; -import java.util.Iterator; -import java.util.Random; - -import com.vaadin.data.util.BeanItem; -import com.vaadin.data.validator.StringLengthValidator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.Resource; -import com.vaadin.server.ThemeResource; -import com.vaadin.server.UserError; -import com.vaadin.ui.Alignment; -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.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.FormLayout; -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.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1878 extends LegacyApplication { - - private Layout orderedLayout; - private Layout gridLayout; - private Layout formLayout; - private GridLayout mainLayout; - private Button switchToGridButton; - private Button switchToOrderedButton; - private Button switchToFormsButton; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - - mainLayout = new GridLayout(1, 2); - w.setContent(mainLayout); - orderedLayout = createOL(); - gridLayout = createGL(); - formLayout = createForms(); - - switchToGridButton = new Button("Switch to GridLayout", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - changeLayout(switchToGridButton, gridLayout); - } - - }); - switchToOrderedButton = new Button("Switch to OrderedLayout", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - changeLayout(switchToOrderedButton, orderedLayout); - } - - }); - switchToOrderedButton.setEnabled(false); - - switchToFormsButton = new Button("Switch to Form", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - changeLayout(switchToFormsButton, formLayout); - } - - }); - - HorizontalLayout buttonLayout = new HorizontalLayout(); - buttonLayout.addComponent(switchToOrderedButton); - buttonLayout.addComponent(switchToGridButton); - buttonLayout.addComponent(switchToFormsButton); - - mainLayout.addComponent(buttonLayout); - mainLayout.addComponent(orderedLayout); - // w.setContent(orderedLayout); - } - - private static Layout createOL() { - GridLayout layout = new GridLayout(1, 5); - - GridLayout l1 = new GridLayout(1, 3); - 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 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); - - return layout; - } - - private static Layout createGL() { - GridLayout layout = new GridLayout(1, 5); - - GridLayout l1 = new GridLayout(1, 3); - createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "100%", null, - true); - createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "50px", null, - false); - GridLayout l2 = new GridLayout(6, 1); - createLayout(l2, new GridLayout(1, 8), "200px", "500px", true); - createLayout(l2, new GridLayout(1, 8), "200px", "500px", "100%", null, - true); - createLayout(l2, new GridLayout(1, 8), "150px", "500px", true); - createLayout(l2, new GridLayout(1, 8), "150px", "500px", "100%", null, - true); - createLayout(l2, new GridLayout(1, 8), "100px", "500px", true); - createLayout(l2, new GridLayout(1, 8), "100px", "500px", "100%", null, - true); - layout.addComponent(l1); - layout.addComponent(l2); - - return layout; - } - - public class FormObject { - private String stringValue = "abc"; - private int intValue = 1; - private long longValue = 2L; - private Date dateValue = new Date(34587034750L); - - public String getStringValue() { - return stringValue; - } - - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } - - public int getIntValue() { - return intValue; - } - - public void setIntValue(int intValue) { - this.intValue = intValue; - } - - public long getLongValue() { - return longValue; - } - - public void setLongValue(long longValue) { - this.longValue = longValue; - } - - public Date getDateValue() { - return dateValue; - } - - public void setDateValue(Date dateValue) { - this.dateValue = dateValue; - } - - } - - private Layout createForms() { - GridLayout layout = new GridLayout(1, 5); - Form form; - - Random r = new Random(); - GridLayout l1 = new GridLayout(1, 3); - form = createForm(l1, "200px", "500px"); - BeanItem<FormObject> item = new BeanItem<FormObject>(new FormObject()); - form.setItemDataSource(item); - for (Iterator<?> i = item.getItemPropertyIds().iterator(); i.hasNext();) { - Object property = i.next(); - Field<?> f = form.getField(property); - - f.setRequired(r.nextBoolean()); - if (r.nextBoolean()) { - f.setIcon(new ThemeResource("icons/16/document-add.png")); - } - if (r.nextBoolean()) { - f.setCaption(null); - } - - f.addValidator(new StringLengthValidator("Error", 10, 8, false)); - } - // createLayout(l1, new - // ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL), - // "1000px", "150px", "50px", null, false); - - // GridLayout l2 = new GridLayout(6, 1); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "200px", "500px", true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "200px", "500px", "100%", null, true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "150px", "500px", true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "150px", "500px", "100%", null, true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "100px", "500px", true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "100px", "500px", "100%", null, true); - layout.addComponent(l1); - // layout.addComponent(l2); - - return layout; - } - - private Form createForm(GridLayout parentLayout, String w, String h) { - FormLayout formLayout = new FormLayout(); - Form form = new Form(formLayout); - - VerticalLayout vl = new VerticalLayout(); - vl.setMargin(true); - vl.setSizeFull(); - Panel p = new Panel("Form " + w + "x" + h, vl); - - p.setWidth(w); - p.setHeight(h); - - parentLayout.addComponent(p); - vl.addComponent(form); - formLayout.setSizeFull(); - - return form; - } - - protected void changeLayout(Button b, Layout newLayout) { - switchToOrderedButton.setEnabled(true); - switchToGridButton.setEnabled(true); - switchToFormsButton.setEnabled(true); - - b.setEnabled(false); - Iterator<Component> i = mainLayout.getComponentIterator(); - i.next(); - Layout l = (Layout) i.next(); - - mainLayout.replaceComponent(l, newLayout); - } - - private static void createLayout(GridLayout parentLayout, Layout newLayout, - String w, String h, boolean align) { - createLayout(parentLayout, newLayout, w, h, null, null, align); - } - - private static void createLayout(GridLayout parentLayout, - final Layout newLayout, String w, String h, String componentWidth, - String componentHeight, boolean align) { - String dirText = "V"; - String type; - if (newLayout instanceof VerticalLayout) { - type = "OL"; - } else if (newLayout instanceof HorizontalLayout) { - dirText = "H"; - type = "OL"; - } else { - if (((GridLayout) newLayout).getColumns() != 1) { - dirText = "H"; - } - type = "GL"; - } - String alignText = align ? "-A" : ""; - String cWidth = componentWidth == null ? "" : " - " + componentWidth; - Panel p = new Panel(type + "/" + dirText + alignText + " " + w + "x" - + h + cWidth, newLayout); - - p.setWidth(w); - p.setHeight(h); - - newLayout.setSizeFull(); - - String captions[] = new String[] { "TextField with caption", null }; - Resource icons[] = new Resource[] { - new ThemeResource("icons/16/document-delete.png"), null }; - boolean required[] = new boolean[] { true, false }; - TextField fields[][] = new TextField[captions.length][icons.length]; - for (int caption = 0; caption < captions.length; caption++) { - for (int icon = 0; icon < icons.length; icon++) { - for (int req = 0; req < required.length; req++) { - TextField tf = createTextFieldWithError(captions[caption], - icons[icon], required[req]); - - fields[caption][icon] = tf; - if (componentWidth != null) { - tf.setWidth(componentWidth); - tf.setValue(tf.getValue() + " w:" + componentWidth); - } - - if (componentHeight != null) { - tf.setHeight(componentWidth); - tf.setValue(tf.getValue() + " h:" + componentHeight); - } - - newLayout.addComponent(tf); - - if (align) { - ((AlignmentHandler) newLayout).setComponentAlignment( - tf, Alignment.BOTTOM_RIGHT); - } - } - } - } - - parentLayout.addComponent(p); - - } - - // private static void createGridLayout(GridLayout parentLayout, int dir, - // String w, String h) { - // createGridLayout(parentLayout, dir, w, h, null, null); - // } - - // private static void createGridLayout(GridLayout parentLayout, int dir, - // String w, String h, String componentWidth, String componentHeight) { - // GridLayout gl; - // if (dir == OrderedLayout.ORIENTATION_HORIZONTAL) { - // gl = new GridLayout(8, 1); - // } else { - // gl = new GridLayout(1, 8); - // } - // - // String dirText = (dir == OrderedLayout.ORIENTATION_HORIZONTAL ? "H" - // : "V"); - // String cWidth = componentWidth == null ? "" : " - " + componentWidth; - // Panel p = new Panel("GL/" + dirText + " " + w + "x" + h + cWidth, gl); - // - // p.setWidth(w); - // p.setHeight(h); - // - // gl.setSizeFull(); - // - // String captions[] = new String[] { "TextField with caption", null }; - // Resource icons[] = new Resource[] { - // new ThemeResource("icons/16/document-delete.png"), null }; - // boolean required[] = new boolean[] { true, false }; - // TextField fields[][] = new TextField[captions.length][icons.length]; - // for (int caption = 0; caption < captions.length; caption++) { - // for (int icon = 0; icon < icons.length; icon++) { - // for (int req = 0; req < required.length; req++) { - // TextField tf = createTextFieldWithError(captions[caption], - // icons[icon], required[req]); - // - // fields[caption][icon] = tf; - // if (componentWidth != null) { - // tf.setWidth(componentWidth); - // } - // - // if (componentHeight != null) { - // tf.setHeight(componentWidth); - // } - // - // p.addComponent(tf); - // gl.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, - // OrderedLayout.ALIGNMENT_BOTTOM); - // } - // } - // } - // - // parentLayout.addComponent(p); - // - // } - - private static TextField createTextFieldWithError(String caption, - Resource icon, boolean required) { - TextField tf = new TextField(); - tf.setCaption(caption); - tf.setIcon(icon); - tf.setRequired(required); - tf.setComponentError(new UserError("Test error message")); - return tf; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1900.java b/uitest/src/com/vaadin/tests/tickets/Ticket1900.java deleted file mode 100644 index 35b7adc7b3..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1900.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Validator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1900 extends LegacyApplication { - - TextField f[] = new TextField[5]; - LegacyWindow main = new LegacyWindow("#1900 test"); - - @Override - public void init() { - - setMainWindow(main); - - for (int i = 0; i < 5; i++) { - final int j = i; - f[i] = new TextField("Testcase " + i); - f[i].setImmediate(true); - f[i].setRequired(true); - main.addComponent(f[i]); - f[i].addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - main.showNotification("Validity test", "Testcase " + j - + " is " + (f[j].isValid() ? "valid" : "invalid")); - } - }); - f[i].addValidator(new ContainsValidator("1")); - f[i].addValidator(new ContainsValidator("2")); - - } - - f[0].setDescription("Field is empty, requiredError(null): *"); - - f[1].setDescription("Field is empty, requiredError(\"foo\"): * (popup shows the validation error)"); - f[1].setRequiredError("The field must not be empty"); - - f[2].setDescription("Field is non-empty, validators do not give validation error: *"); - f[2].setValue("valid 12"); - - f[3].setDescription("Field is non-empty, requiredError(null), validators " - + "give validation error: * ! (popup shows the validation error)"); - f[3].setValue("invalid"); - - f[4].setDescription("Field is non-empty, requiredError(\"foo\"), validators " - + "give validation error: * ! (popup shows the validation error)"); - f[4].setValue("invalid"); - f[4].setRequiredError("The field must not be empty"); - - } - - static class ContainsValidator implements Validator { - private final String c; - - public ContainsValidator(String c) { - this.c = c; - } - - @Override - public void validate(Object value) throws InvalidValueException { - if (value == null || !value.toString().contains(c)) { - throw new InvalidValueException("Value does not contain " + c); - } - - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1904.java b/uitest/src/com/vaadin/tests/tickets/Ticket1904.java deleted file mode 100644 index 677d88057c..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1904.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1904 extends LegacyApplication { - - @Override - public void init() { - setMainWindow(new LegacyWindow("#1904")); - setTheme("tests-tickets"); - - addOL("defaults", null, false); - addOL("l5,r10,t20,b40,vs20,hs40", "ticket1904", false); - addOL("l5,r10,t20,b40,vs20,hs40", "ticket1904", true); - } - - private void addOL(String descr, String style, boolean horizontal) { - AbstractOrderedLayout ol; - if (horizontal) { - ol = new HorizontalLayout(); - } else { - ol = new VerticalLayout(); - } - ol.setMargin(true); - ol.setSpacing(true); - if (style != null) { - ol.setStyleName(style); - } - ol.addComponent(new Label(descr)); - for (int i = 0; i < 3; i++) { - Button b = new Button("Row " + (i + 1)); - if (!horizontal) { - b.setWidth("500px"); - } - ol.addComponent(b); - } - getMainWindow().addComponent(ol); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1916.java b/uitest/src/com/vaadin/tests/tickets/Ticket1916.java deleted file mode 100644 index 16e930b754..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1916.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.UserError; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket1916 extends LegacyApplication { - - @Override - public void init() { - - HorizontalLayout test = new HorizontalLayout(); - test.setSizeFull(); - - TextField tf = new TextField(); - tf.setComponentError(new UserError("Error message")); - - test.addComponent(tf); - test.setComponentAlignment(tf, Alignment.MIDDLE_CENTER); - - LegacyWindow w = new LegacyWindow("Test #1916", test); - setMainWindow(w); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1919.java b/uitest/src/com/vaadin/tests/tickets/Ticket1919.java deleted file mode 100644 index 086313823e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1919.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Component; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; - -public class Ticket1919 extends com.vaadin.server.LegacyApplication { - - private GridLayout lo; - private boolean on = true; - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - setTheme("tests-tickets"); - - lo = new GridLayout(2, 2); - lo.setSizeFull(); - lo.setMargin(true); - lo.setSpacing(true); - - lo.addComponent(getTestComponent()); - lo.addComponent(getTestComponent()); - lo.addComponent(getTestComponent()); - lo.addComponent(getTestComponent()); - - main.setContent(lo); - - } - - public void toggleStyleName() { - if (on) { - lo.setStyleName("test"); - } else { - lo.setStyleName(""); - } - on = !on; - } - - private Component getTestComponent() { - Panel p = new Panel(); - p.setSizeFull(); - - Button b = new Button("toggle Values", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - toggleStyleName(); - } - }); - p.setContent(b); - return p; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java b/uitest/src/com/vaadin/tests/tickets/Ticket1921.java deleted file mode 100644 index ab43b45576..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1921.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.IOException; -import java.util.Map; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.RequestHandler; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinSession; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1921 extends LegacyApplication implements RequestHandler { - - int state = -1; - int round = 1; - Button button; - VerticalLayout outer, inner; - - @Override - public void init() { - - outer = new VerticalLayout(); - setMainWindow(new LegacyWindow("#1921", outer)); - setTheme("tests-tickets"); - inner = new VerticalLayout(); - outer.addComponent(inner); - button = new Button("foo", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - newState(); - } - }); - inner.addComponent(button); - - outer.setStyleName("red"); - inner.setStyleName("blue"); - - newState(); - - VaadinSession.getCurrent().addRequestHandler(this); - } - - public void newState() { - - if (state >= 6) { - state = 0; - round++; - } else { - state++; - } - - button.setCaption("state " + round + "." + state); - - switch (state) { - - case 0: - outer.setMargin(true); - inner.setMargin(true); - inner.setSizeFull(); - outer.setSizeFull(); - button.setSizeFull(); - break; - - case 1: - button.setSizeUndefined(); - break; - - case 2: - inner.setMargin(false); - break; - - case 3: - outer.setMargin(false); - break; - - case 4: - inner.setMargin(true); - break; - - case 5: - inner.addComponent(new Label("Added at " + button.getCaption())); - break; - - case 6: - outer.addComponent(new Label("Added at " + button.getCaption())); - break; - - } - } - - @Override - public boolean handleRequest(VaadinSession session, VaadinRequest request, - VaadinResponse response) throws IOException { - Map<String, String[]> parameters = request.getParameterMap(); - String[] s = parameters.get("state"); - if (s == null || s.length != 1) { - return false; - } - String v[] = s[0].split("\\."); - if (v == null || v.length != 2) { - return false; - } - try { - int rr = Integer.parseInt(v[0]); - int rs = Integer.parseInt(v[1]); - if (rr < round || (rr == round && rs < state)) { - getMainWindow().showNotification( - "Already past requested " + s[0]); - return false; - } - while (round < rr || state < rs) { - newState(); - } - } catch (NumberFormatException ignored) { - } - return false; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1923.java b/uitest/src/com/vaadin/tests/tickets/Ticket1923.java deleted file mode 100644 index 939fe05e58..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1923.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1923 extends com.vaadin.server.LegacyApplication { - - private static final int ROWS = 50; - - private Panel p; - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("TestPanel 250x300", pl); - // p.getLayout().setWidth("100%"); - // p.setContent(new GridLayout(1, 100)); - for (int i = 0; i < ROWS; i++) { - pl.addComponent(new Label( - "Label" - + i - + " 5067w09adsfasdjfahlsdfjhalfjhaldjfhalsjdfhlajdhflajhdfljahdslfjahldsjfhaljdfhaljfdhlajsdhflajshdflkajhsdlfkjahsldfkjahsldfhalskjfdhlksjfdh857idifhaljsdfhlajsdhflajhdflajhdfljahldfjhaljdfhalsjdfhalkjdhflkajhdfljahsdlfjahlsdjfhaldjfhaljfdhlajdhflajshdfljahsdlfjhalsjdfhalskjhfdlhusfglksuhdflgjshflgjhslfghslfjghsljfglsjhfglsjhfgljshfgljshflgjhslfghsljfgsljdfglsdjhfglsjhflgkjshfldjgh")); - } - // main.getLayout().setSizeFull(); - - p.setHeight("300px"); - p.setWidth("250px"); - // p.setWidth("50%"); - - p.setScrollTop(100); - p.setScrollLeft(100); - - main.addComponent(p); - - VerticalLayout ol = new VerticalLayout(); - pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("a", pl); - pl.addComponent(new Label("Longer than caption")); - ol.addComponent(p); - - main.addComponent(ol); - - ol = new VerticalLayout(); - pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("captionasdfjahsdjfh this should be clipped god damn it", - pl); - // p.getLayout().setSizeFull(); - p.setWidth("50px"); - p.setHeight("100px"); - pl.addComponent(new Label( - "aasdfaasdfja dslkfj lakfdj lakjdf lkaj dflkaj ldfkj alsdfj laksdj flkajs dflkj sdfsadfasdfasd")); - ol.addComponent(p); - - main.addComponent(ol); - - ol = new VerticalLayout(); - pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("300x-1", pl); - // p.getLayout().setSizeFull(); - p.setWidth("300px"); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - pl.addComponent(new Label("Short")); - ol.addComponent(p); - - main.addComponent(ol); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1925.java b/uitest/src/com/vaadin/tests/tickets/Ticket1925.java deleted file mode 100644 index c00404ba98..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1925.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1925 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow mainWindow = new LegacyWindow("Test åäö"); - setMainWindow(mainWindow); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1939.java b/uitest/src/com/vaadin/tests/tickets/Ticket1939.java deleted file mode 100644 index 9b360d1da7..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1939.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1939 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - - final VerticalLayout l = new VerticalLayout(); - l.setWidth("400px"); - l.setHeight("100px"); - l.addComponent(new TextField("This one works fine")); - TextField t = new TextField(); - t.setRequired(true); - t.setValue("This one bugs"); - l.addComponent(t); - w.addComponent(l); - - w.addComponent(new Button("show me the bug", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - l.setWidth(null); - } - })); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1940.java b/uitest/src/com/vaadin/tests/tickets/Ticket1940.java deleted file mode 100644 index 79790f4414..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1940.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1940 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - - final VerticalLayout l = new VerticalLayout(); - l.setWidth("200px"); - l.setHeight(null); - TextField t = new TextField(); - l.addComponent(t); - t.setRequired(true); - w.addComponent(l); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1953.java b/uitest/src/com/vaadin/tests/tickets/Ticket1953.java deleted file mode 100644 index 98c55329da..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1953.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1953 extends LegacyApplication { - public static final String cellStyle = "test-cell"; - public static final String colHeadStyle = "test-col-head"; - public static final String headingStyle = "test-heading"; - public static final String spacerStyle = "test-spacer"; - public static final String pageButtonStyle = "test-page-change"; - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - setTheme("tests-tickets"); - GridLayout gl = new GridLayout(5, 5); - - gl.setStyleName("borders"); - - gl.addComponent(new Label("0,0"), 0, 0); - gl.addComponent(new Label("0,1"), 0, 1); - gl.addComponent(new Label("0,2"), 0, 2); - gl.addComponent(new Label("0,3"), 0, 3); - gl.addComponent(new Label("0,4"), 0, 4); - gl.addComponent(new Label("1,0"), 1, 0); - gl.addComponent(new Label("2,0"), 2, 0); - gl.addComponent(new Label("3,0"), 3, 0); - gl.addComponent(new Label("4,0"), 4, 0); - - gl.addComponent(new Label("1,4"), 1, 4); - gl.addComponent(new Label("2,4"), 2, 4); - gl.addComponent(new Label("3,4"), 3, 4); - gl.addComponent(new Label("4,4"), 4, 4); - - gl.addComponent(new Label("1-1 -> 2-2"), 1, 1, 2, 2); - gl.addComponent(new Label("3,1"), 3, 1); - gl.addComponent(new Label("3,2"), 3, 2); - gl.addComponent(new Label("3,3"), 3, 3); - - main.addComponent(gl); - - // create grid - GridLayout grid = new GridLayout(7, 7); - - grid.setStyleName("borders"); - - // add upper row - Button up = new Button("UP"); - - up.setStyleName(pageButtonStyle); - grid.addComponent(up, 0, 0); - - Label space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, 1, 0); - - Button single = null; - String headingStyle = "foo"; - for (int i = 1; i < grid.getColumns() - 2; i++) { - single = new Button(Integer.toString(i)); - single.setStyleName(headingStyle); - grid.addComponent(single, i + 1, 0); - } - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, grid.getColumns() - 1, 0); - - // middle rows - char rowChar = 'A'; - for (int i = 1; i < grid.getRows() - 1; i++) { - space = new Label(Character.toString(rowChar++)); - space.setStyleName(colHeadStyle); - grid.addComponent(space, 0, i); - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, 1, i); - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, grid.getColumns() - 1, i); - } - - // bottom row - Button dn = new Button("DOWN"); - dn.setStyleName(pageButtonStyle); - grid.addComponent(dn, 0, grid.getRows() - 1); - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, 1, grid.getRows() - 1); - - for (int i = 1; i < grid.getColumns() - 2; i++) { - single = new Button(Integer.toString(i)); - single.setStyleName(headingStyle); - grid.addComponent(single, i + 1, grid.getRows() - 1); - } - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, grid.getColumns() - 1, grid.getRows() - 1); - - main.addComponent(grid); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1966.java b/uitest/src/com/vaadin/tests/tickets/Ticket1966.java deleted file mode 100644 index 2023094458..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1966.java +++ /dev/null @@ -1,115 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -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.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1966 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - // setTheme("tests-tickets"); - w.setContent(new GridLayout(2, 2)); - // w.getLayout().setSizeFull(); - createUI((Layout) w.getContent()); - } - - private void createUI(Layout layout) { - orderedLayout(layout); - gridLayout(layout); - } - - private void gridLayout(Layout layout) { - Panel p = new Panel("GridLayout"); - layout.addComponent(p); - - GridLayout gl = new GridLayout(1, 4); - gl.setMargin(true); - gl.setCaption("Horizontal"); - Button b; - - b = new Button("Wide button"); - b.setWidth("500px"); - gl.addComponent(b); - - addButtons(gl); - - p.setContent(gl); - - /* VERTICAL */ - - gl = new GridLayout(4, 1); - gl.setMargin(true); - gl.setCaption("Vertical"); - - addButtons(gl); - - b = new Button("High button"); - b.setHeight("200px"); - gl.addComponent(b); - - p.setContent(gl); - - } - - private void orderedLayout(Layout layout) { - Panel p = new Panel("OrderedLayout"); - layout.addComponent(p); - - AbstractOrderedLayout ol = new VerticalLayout(); - ol.setMargin(true); - ol.setCaption("Horizontal"); - // ol.setWidth("100%"); - - Button b; - - b = new Button("Wide button"); - b.setWidth("500px"); - ol.addComponent(b); - - addButtons(ol); - p.setContent(ol); - - /* VERTICAL */ - - ol = new HorizontalLayout(); - ol.setMargin(true); - ol.setCaption("Vertical"); - - addButtons(ol); - b = new Button("High button"); - b.setHeight("200px"); - ol.addComponent(b); - - p.setContent(ol); - - } - - private void addButtons(Layout ol) { - 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, Alignment align) { - Button b = new Button("Narrow Button - " - + align.getHorizontalAlignment() + " - " - + align.getVerticalAlignment()); - b.setWidth("100px"); - ((AlignmentHandler) l).setComponentAlignment(b, align); - - return b; - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1966_2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1966_2.java deleted file mode 100644 index 2088e64d9a..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1966_2.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -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.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1966_2 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - w.setContent(new GridLayout(2, 2)); - - // Panel p = new Panel("test"); - // p.setWidth(500); - // p.setHeight(500); - // p.setContent(new GridLayout(1, 2)); - // p.getLayout().setSizeFull(); - // - // p.addComponent(new Button("asjkdfhakshdf")); - // p.addComponent(new Button("öalijgto8aq5")); - - // GridLayout gl = new GridLayout(4, 1); - // // gl.setCaption("Vertical"); - // gl.setWidth("100%"); - // gl.setHeight(500); - - // addButtons(gl); - // gl.addComponent(new Label("abc")); - // p.addComponent(gl); - - // w.getLayout().addComponent(p); - createUI((Layout) w.getContent()); - } - - private void createUI(Layout layout) { - orderedLayout(layout); - gridLayout(layout); - expandLayout(layout); - } - - private void gridLayout(Layout layout) { - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel("GridLayout", pl); - p.setWidth("500px"); - p.setHeight("500px"); - pl.setSizeFull(); - layout.addComponent(p); - - GridLayout gl = new GridLayout(1, 4); - gl.setMargin(true); - gl.setCaption("Horizontal"); - gl.setWidth("100%"); - - // Button b; - - // b = new Button("Wide button"); - // b.setWidth("500"); - // gl.addComponent(b); - - addButtons(gl); - - p.setContent(gl); - - /* VERTICAL */ - - gl = new GridLayout(4, 1); - gl.setMargin(true); - // gl.setCaption("Vertical"); - gl.setHeight("100%"); - addButtons(gl); - - // Button b = new Button("High button"); - // b.setHeight(200); - // gl.addComponent(b); - - p.setContent(gl); - - } - - private void orderedLayout(Layout layout) { - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel("OrderedLayout", pl); - p.setWidth("500px"); - p.setHeight("500px"); - pl.setWidth("100%"); - layout.addComponent(p); - - AbstractOrderedLayout ol = new VerticalLayout(); - ol.setMargin(true); - // ol.setCaption("Horizontal"); - ol.setWidth("100%"); - addButtons(ol); - pl.addComponent(ol); - - /* VERTICAL */ - - ol = new HorizontalLayout(); - ol.setMargin(true); - // ol.setCaption("Vertical"); - ol.setHeight("200px"); - addButtons(ol); - // Button b = new Button("High button"); - // b.setHeight(200); - // ol.addComponent(b); - pl.addComponent(ol); - - } - - private void expandLayout(Layout layout) { - VerticalLayout panelLayout = new VerticalLayout(); - panelLayout.setMargin(true); - Panel p = new Panel("ExpandLayout", panelLayout); - layout.addComponent(p); - panelLayout.setWidth("500"); - panelLayout.setHeight("400"); - - AbstractOrderedLayout el = new VerticalLayout(); - // el.setCaption("Horizontal"); - // el.setSizeUndefined(); - // el.setWidth("100%"); - // ol.setWidth("100%"); - Button b; - - b = new Button("Wide button"); - b.setWidth("100%"); - // b.setHeight(200); - // el.setExpandRatio(b,1); - // el.addComponent(b); - - addButtons(el); - panelLayout.addComponent(el); - - /* VERTICAL */ - - el = new HorizontalLayout(); - // el.setHeight(400); - // el.setWidth("100%"); - // el.setCaption("Vertical"); - - addButtons(el); - // b = new Button("High button"); - // el.setExpandRatio(b,1); - // b.setHeight(100); - // el.addComponent(b); - - panelLayout.addComponent(el); - - } - - private void addButtons(Layout ol) { - 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, Alignment align) { - Button b = new Button(align.getHorizontalAlignment() + " - " - + align.getVerticalAlignment()); - // b.setWidth("100"); - ((AlignmentHandler) l).setComponentAlignment(b, align); - - return b; - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1966_3.java b/uitest/src/com/vaadin/tests/tickets/Ticket1966_3.java deleted file mode 100644 index 421bea27f9..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1966_3.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.ThemeResource; -import com.vaadin.server.UserError; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1966_3 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - VerticalLayout ol = new VerticalLayout(); - Panel p = new Panel(ol); - p.setWidth("300px"); - p.setHeight("300px"); - ol.setSizeFull(); - - TextField tf = new TextField("Long caption, longer than 100 pixels"); - tf.setWidth("100px"); - - ol.addComponent(tf); - 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, Alignment.TOP_RIGHT); - - tf = new TextField("Short caption"); - tf.setComponentError(new UserError("error message")); - tf.setIcon(new ThemeResource("icons/16/calendar.png")); - tf.setWidth("100px"); - - tf.setComponentError(new UserError("error message")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_RIGHT); - - tf = new TextField(); - tf.setValue("No caption"); - tf.setWidth("100px"); - - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_RIGHT); - - layout.addComponent(p); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1969.java b/uitest/src/com/vaadin/tests/tickets/Ticket1969.java deleted file mode 100644 index 73746fb07d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1969.java +++ /dev/null @@ -1,110 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.UserError; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1969 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.getContent().setSizeFull(); - - TabSheet ts = new TabSheet(); - ts.setSizeFull(); - - final Table t = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(7, 2000); - t.setSizeFull(); - ts.addTab(t, "Table, scrollins should not flash", null); - - final Label testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - final VerticalLayout actions = new VerticalLayout(); - - actions.setCaption("Test actions"); - - ts.addTab(actions); - - Button b; - - b = new Button( - "change introduction caption (should add * to tab name)", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - testContent.setCaption(testContent.getCaption() + "*"); - } - }); - actions.addComponent(b); - - b = new Button("change tab caption (should add * to tab name)", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - actions.setCaption(actions.getCaption() + "*"); - } - }); - - actions.addComponent(b); - - final UserError e = new UserError("Test error"); - - b = new Button("Toggle error", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - if (testContent.getComponentError() == null) { - testContent.setComponentError(e); - } else { - testContent.setComponentError(null); - } - } - }); - actions.addComponent(b); - - b = new Button("Change table caption", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - t.setCaption(t.getCaption() + "*"); - } - }); - actions.addComponent(b); - - b = new Button("Toggle Table error", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - if (t.getComponentError() == null) { - t.setComponentError(e); - } else { - t.setComponentError(null); - } - } - }); - - actions.addComponent(b); - - for (int i = 0; i < 20; i++) { - Label l = new Label("Test Content"); - l.setCaption("Extra tab " + i); - ts.addComponent(l); - } - - main.addComponent(ts); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1970.java b/uitest/src/com/vaadin/tests/tickets/Ticket1970.java deleted file mode 100644 index eb98153be0..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1970.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1970 extends LegacyApplication { - - @Override - public void init() { - setMainWindow(createWindow()); - } - - @Override - public LegacyWindow getWindow(String name) { - - // If we already have the requested window, use it - LegacyWindow w = super.getWindow(name); - if (w == null) { - - // If no window found, create it - w = createExtraWindow(name); - } - return w; - } - - private LegacyWindow createExtraWindow(String name) { - final LegacyWindow w = new LegacyWindow("Extra window: " + name); - w.setName(name); - addWindow(w); - w.addComponent(new Label( - "This window has been created on fly for name: " + name)); - w.addComponent(new Button("Show open windows", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - String openWindows = ""; - for (Iterator<LegacyWindow> i = getWindows().iterator(); i - .hasNext();) { - LegacyWindow t = i.next(); - openWindows += (openWindows.length() > 0 ? "," : "") - + t.getName(); - } - w.showNotification(openWindows); - } - })); - - return w; - } - - private LegacyWindow createWindow() { - final LegacyWindow w = new LegacyWindow(); - w.addComponent(new Button("Show the name of the application", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - w.showNotification("Name of this window = " - + w.getName()); - } - })); - w.addComponent(new Label("<a href='" + getURL().toExternalForm() + "'>" - + getURL().toExternalForm() + "</a>", ContentMode.HTML)); - w.addComponent(new Label( - "<h2>How to reproduce</h2>Open the above link in another browser" - + " window and then press the Show-button on this window.", - ContentMode.HTML)); - - return w; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1972.java b/uitest/src/com/vaadin/tests/tickets/Ticket1972.java deleted file mode 100644 index 3d0adb6588..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1972.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1972 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - setTheme("tests-ticket"); - GridLayout layout = new GridLayout(3, 3); - layout.setStyleName("borders"); - layout.addComponent(new Label("1-1")); - layout.space(); - layout.space(); - layout.addComponent(new Label("2-1")); - layout.space(); - layout.space(); - layout.addComponent(new Label("3-1")); - layout.space(); - layout.addComponent(new Label("3-3")); - - w.setContent(layout); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1973.java b/uitest/src/com/vaadin/tests/tickets/Ticket1973.java deleted file mode 100644 index c4e7dbfcd7..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1973.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1973 extends com.vaadin.server.LegacyApplication { - - LegacyWindow main = new LegacyWindow(); - Table table = new Table(); - - @Override - public void init() { - setMainWindow(main); - - final IndexedContainer container1 = new IndexedContainer(); - container1.addContainerProperty("layout", Component.class, null); - - final IndexedContainer container2 = new IndexedContainer(); - container2.addContainerProperty("layout", Component.class, null); - - fill(container1, 100, "Testi 1 :"); - fill(container2, 100, "Testi 2 :"); - - table.setContainerDataSource(container1); - - Button refreshTable = new Button("Change table container"); - refreshTable.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent e) { - table.setContainerDataSource(container2); - table.setContainerDataSource(container1); - } - }); - - main.addComponent(table); - main.addComponent(refreshTable); - } - - public void fill(IndexedContainer container, int size, String prefix) { - for (int i = 0; i < size; i++) { - Item item = container.addItem(new Integer(i)); - VerticalLayout layout = new VerticalLayout(); - layout.addComponent(new Button(prefix + i)); - item.getItemProperty("layout").setValue(layout); - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1973_2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1973_2.java deleted file mode 100644 index 301d9931ad..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1973_2.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket1973_2 extends LegacyApplication { - LegacyWindow main = new LegacyWindow(); - Table table = new Table(); - - @Override - public void init() { - setMainWindow(main); - - final IndexedContainer container1 = new IndexedContainer(); - container1.addContainerProperty("text", String.class, null); - container1.addContainerProperty("layout", Component.class, null); - - final IndexedContainer container2 = new IndexedContainer(); - container2.addContainerProperty("text", String.class, null); - container2.addContainerProperty("layout", Component.class, null); - - fill(container1, 100); - - table.setContainerDataSource(container1); - - Button refreshTable = new Button("Change table container"); - refreshTable.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent e) { - table.setContainerDataSource(container2); - table.setContainerDataSource(container1); - } - }); - - main.addComponent(table); - main.addComponent(refreshTable); - } - - public void fill(IndexedContainer container, int size) { - for (int i = 0; i < size; i++) { - int randInt = i; - Item item = container.addItem(new Integer(i)); - VerticalLayout layout = new VerticalLayout(); - layout.setId("lo" + i); - layout.addComponent(new Button("Test " + randInt)); - item.getItemProperty("layout").setValue(layout); - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1975.java b/uitest/src/com/vaadin/tests/tickets/Ticket1975.java deleted file mode 100644 index 18caac808b..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1975.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.VaadinService; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1975 extends LegacyApplication { - - private CustomLayout cl1; - private CustomLayout cl2; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - setTheme("tests-tickets"); - GridLayout layout = new GridLayout(1, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - String s = "<b>Blah</b><input type=\"text\" value='Lorem\" ipsum'/>"; - try { - cl1 = new CustomLayout(new ByteArrayInputStream(s.getBytes())); - layout.addComponent(cl1); - - layout.addComponent(new Button("Disable/Enable", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - boolean e = cl1.isEnabled(); - - cl1.setEnabled(!e); - cl2.setEnabled(!e); - } - - })); - File baseDir = VaadinService.getCurrent().getBaseDirectory() - .getAbsoluteFile(); - File f = new File(baseDir + "/VAADIN/themes/" + getTheme() - + "/layouts/Ticket1975.html"); - - cl2 = new CustomLayout(new FileInputStream(f)); - layout.addComponent(cl2); - - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1982.java b/uitest/src/com/vaadin/tests/tickets/Ticket1982.java deleted file mode 100644 index d8ec0f63fb..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1982.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket1982 extends LegacyApplication { - - private List<TitleBar> components = new ArrayList<TitleBar>(); - - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - GridLayout gl = new GridLayout(2, 2); - gl.setSizeFull(); - main.setContent(gl); - gl.setMargin(true); - - TitleBar t1 = new TitleBar("Title 1", gl); - TitleBar t2 = new TitleBar("Title 2", gl); - TitleBar t3 = new TitleBar("Title 3", gl); - TitleBar t4 = new TitleBar("Title 4", gl); - components.add(t1); - components.add(t2); - components.add(t3); - components.add(t4); - - restoreComponents(gl); - - } - - private void restoreComponents(GridLayout gl) { - gl.removeAllComponents(); - gl.addComponent(components.get(0)); - gl.addComponent(components.get(1)); - gl.addComponent(components.get(2)); - gl.addComponent(components.get(3)); - } - - private class TitleBar extends HorizontalLayout { - - private Button max = new Button("Max"); - private Button min = new Button("Min"); - private GridLayout layout; - - public TitleBar(String title, GridLayout layout) { - super(); - this.layout = layout; - addComponent(new Label(title)); - addComponent(max); - addComponent(min); - min.setVisible(false); - - max.addListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - min.setVisible(true); - max.setVisible(false); - TitleBar.this.layout.removeAllComponents(); - TitleBar.this.layout - .addComponent(TitleBar.this, 0, 0, 1, 1); - } - }); - min.addListener(new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - min.setVisible(false); - max.setVisible(true); - restoreComponents(TitleBar.this.layout); - } - }); - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1983.java b/uitest/src/com/vaadin/tests/tickets/Ticket1983.java deleted file mode 100644 index 789e8c3a45..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1983.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.Sizeable; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -/** - * Test class for ticket 1983 - */ -public class Ticket1983 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow main = new LegacyWindow("Test for ticket 1983"); - main.setContent(new TestLayout()); - setMainWindow(main); - } - - private static class TestLayout extends HorizontalSplitPanel { - boolean isLong = true; - final Table table = new MyTable(); - final String propId = "col"; - final String propId2 = "col2"; - - public TestLayout() { - - setSplitPosition(200, Sizeable.UNITS_PIXELS); - setLocked(true); - - final HorizontalSplitPanel leftSide = initLeftSide(); - setFirstComponent(leftSide); - - final Layout rightSide = new VerticalLayout(); - rightSide.setHeight("100%"); - setSecondComponent(rightSide); - } - - private HorizontalSplitPanel initLeftSide() { - final HorizontalSplitPanel leftSide = new HorizontalSplitPanel(); - leftSide.setHeight("100%"); - - final IndexedContainer dataSource = new IndexedContainer(); - dataSource.addContainerProperty(propId, String.class, null); - dataSource.addContainerProperty(propId2, String.class, null); - final Object itemId = dataSource.addItem(); - dataSource - .getItem(itemId) - .getItemProperty(propId) - .setValue( - "Very long value that makes a scrollbar appear for sure"); - dataSource - .getItem(itemId) - .getItemProperty(propId2) - .setValue( - "Very long value that makes a scrollbar appear for sure"); - - for (int i = 0; i < 150; i++) { - Object id = dataSource.addItem(); - dataSource - .getItem(id) - .getItemProperty(propId) - .setValue( - (i == 100 ? "Very long value that makes a scrollbar appear for sure" - : "Short")); - dataSource.getItem(id).getItemProperty(propId2) - .setValue("Short"); - } - - table.setSizeFull(); - table.setContainerDataSource(dataSource); - table.setVisibleColumns(new Object[] { propId }); - - leftSide.setSecondComponent(table); - - Button button = new Button("Change col value to short"); - button.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - // Change the column value to a short one --> Should remove - // the scrollbar - if (isLong) { - dataSource.getItem(itemId).getItemProperty(propId) - .setValue("Short value"); - dataSource.getItem(itemId).getItemProperty(propId2) - .setValue("Short value"); - isLong = false; - } else { - dataSource - .getItem(itemId) - .getItemProperty(propId) - .setValue( - "Very long value that makes a scrollbar appear for sure"); - dataSource - .getItem(itemId) - .getItemProperty(propId2) - .setValue( - "Very long value that makes a scrollbar appear for sure"); - isLong = true; - } - // Works the same way with or without repaint request - table.markAsDirty(); - } - }); - - VerticalLayout ol = new VerticalLayout(); - ol.addComponent(button); - leftSide.setFirstComponent(ol); - - CheckBox checkBox = new CheckBox("Two col"); - checkBox.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - if ((Boolean) event.getProperty().getValue()) { - table.setVisibleColumns(new Object[] { propId, propId2 }); - } else { - table.setVisibleColumns(new Object[] { propId }); - } - - } - - }); - ol.addComponent(checkBox); - - return leftSide; - } - } - - static class MyTable extends Table { - MyTable() { - alwaysRecalculateColumnWidths = true; - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1986.java b/uitest/src/com/vaadin/tests/tickets/Ticket1986.java deleted file mode 100644 index f58a54ec9a..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1986.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.DateField; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.TextField; -import com.vaadin.ui.TwinColSelect; - -public class Ticket1986 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - - int index = 1; - - GridLayout layout = new GridLayout(2, 2); - TextField f1 = new TextField("1"); - f1.setTabIndex(index++); - TextField f2 = new TextField("2"); - f2.setTabIndex(index++); - - DateField f3 = new DateField("3"); - f3.setTabIndex(index++); - ComboBox cb = new ComboBox("4"); - cb.setTabIndex(index++); - - ListSelect lss = new ListSelect("5"); - lss.addItem("foo"); - lss.addItem("Bar"); - lss.setTabIndex(index++); - - NativeSelect ns = new NativeSelect("6"); - ns.addItem("foo"); - ns.addItem("bar"); - ns.setTabIndex(index++); - - OptionGroup og = new OptionGroup("7"); - og.addItem("foo"); - og.addItem("bar"); - og.setTabIndex(index++); - - OptionGroup ogm = new OptionGroup("7"); - ogm.setMultiSelect(true); - ogm.addItem("foo"); - ogm.addItem("bar"); - ogm.setTabIndex(index++); - - TwinColSelect ts = new TwinColSelect("8"); - ts.addItem("Foo"); - ts.addItem("Bar"); - ts.setTabIndex(index++); - - Button b = new Button("9"); - b.setTabIndex(index++); - - layout.addComponent(b); - layout.addComponent(ts); - layout.addComponent(ogm); - layout.addComponent(og); - layout.addComponent(ns); - layout.addComponent(lss); - layout.addComponent(cb); - layout.addComponent(f3); - layout.addComponent(f2); - layout.addComponent(f1); - - w.setContent(layout); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1991.java b/uitest/src/com/vaadin/tests/tickets/Ticket1991.java deleted file mode 100644 index 02175ea5d1..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1991.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -public class Ticket1991 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - Table t = new Table("Test table"); - - t.addContainerProperty(" ", CheckBox.class, ""); - t.addContainerProperty("Col1", String.class, ""); - t.addContainerProperty("Col2", String.class, ""); - - t.setPageLength(5); - - t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "1"); - t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "2"); - - main.addComponent(t); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1995.java b/uitest/src/com/vaadin/tests/tickets/Ticket1995.java deleted file mode 100644 index 402baa1d34..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1995.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Container; -import com.vaadin.data.Container.Filterable; -import com.vaadin.data.Item; -import com.vaadin.data.util.filter.SimpleStringFilter; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -public class Ticket1995 extends LegacyApplication { - - private static final Object PROPERTY_1 = "Test"; - private Table table; - - @Override - public void init() { - final LegacyWindow mainWin = new LegacyWindow(getClass().getName()); - setMainWindow(mainWin); - - table = new Table(); - table.addContainerProperty(PROPERTY_1, String.class, ""); - table.setPageLength(4); - - Item item = table.addItem("1"); - item.getItemProperty(PROPERTY_1).setValue("Row 1"); - item = table.addItem("2"); - item.getItemProperty(PROPERTY_1).setValue("Row 2"); - - Filterable filterable = (Container.Filterable) table - .getContainerDataSource(); - filterable.addContainerFilter(new SimpleStringFilter(PROPERTY_1, "Row", - true, false)); - - table.setColumnHeader(PROPERTY_1, "Test (filter: Row)"); - - mainWin.addComponent(table); - mainWin.addComponent(new Button("Add item", - new com.vaadin.ui.Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - addItem(); - } - })); - } - - protected void addItem() { - Filterable filterable = (Container.Filterable) table - .getContainerDataSource(); - - Item i = table.addItem("abc"); - String res = ""; - if (i == null) { - res = "FAILED"; - } else { - res = "OK!"; - } - - getMainWindow().showNotification("Tried to add item 'abc', " + res); - - filterable.addContainerFilter(new SimpleStringFilter(PROPERTY_1, "Row", - true, false)); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket20.java b/uitest/src/com/vaadin/tests/tickets/Ticket20.java deleted file mode 100644 index 5f6305bcb0..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket20.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Validator; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.data.validator.CompositeValidator; -import com.vaadin.data.validator.CompositeValidator.CombinationMode; -import com.vaadin.data.validator.IntegerValidator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket20 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow("Test app for #20"); - setMainWindow(mainWin); - - final TextField tx = new TextField("Integer"); - mainWin.addComponent(tx); - tx.setImmediate(true); - CompositeValidator v = new CompositeValidator(); - v.addValidator(new IntegerValidator("{0} is not a number")); - v.addValidator(new Validator() { - - private boolean isValid(Object value) { - try { - int i = Integer.parseInt("" + value); - if (i < 0) { - return false; - } - return true; - } catch (NumberFormatException e) { - return false; - } - } - - @Override - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException(value - + " is not a non-negative number"); - } - } - }); - CompositeValidator v2 = new CompositeValidator(CombinationMode.OR, null); - v2.addValidator(v); - v2.addValidator(new Validator() { - - @Override - public void validate(Object value) throws InvalidValueException { - if (!"".equals("" + value)) { - throw new InvalidValueException("Value is not empty string"); - } - } - }); - tx.addValidator(v2); - - final String[] visibleProps = { "required", "invalidAllowed", - "readOnly", "readThrough", "invalidCommitted", - "validationVisible" }; - for (int i = 0; i < visibleProps.length; i++) { - CheckBox b = new CheckBox(visibleProps[i], - new MethodProperty<Boolean>(tx, visibleProps[i])); - b.setImmediate(true); - mainWin.addComponent(b); - } - - mainWin.addComponent(new Button("Validate integer", - new Button.ClickListener() { - @Override - public void buttonClick( - com.vaadin.ui.Button.ClickEvent event) { - mainWin.showNotification("The field is " - + (tx.isValid() ? "" : "not ") + "valid"); - } - })); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2001.java b/uitest/src/com/vaadin/tests/tickets/Ticket2001.java deleted file mode 100644 index cf442e2218..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2001.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2001 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - - final VerticalLayout l = new VerticalLayout(); - l.addComponent(new Label("row 1")); - l.addComponent(new Label("row 2")); - w.addComponent(l); - - final CheckBox b = new CheckBox("fixed width: 30px", false); - b.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - if (b.getValue()) { - l.setWidth("30px"); - } else { - l.setWidth(null); - } - } - }); - b.setImmediate(true); - w.addComponent(b); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2002.java b/uitest/src/com/vaadin/tests/tickets/Ticket2002.java deleted file mode 100644 index 5424c31e8a..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2002.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.MethodProperty; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket2002 extends LegacyApplication { - private Long long1 = new Long(1L); - private Long long2 = new Long(2L); - - public Long getLong1() { - return long1; - } - - public void setLong1(Long long1) { - this.long1 = long1; - } - - public Long getLong2() { - return long2; - } - - public void setLong2(Long long2) { - this.long2 = long2; - } - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - - GridLayout layout = new GridLayout(2, 2); - layout.setSpacing(true); - - TextField f1 = new TextField("Non-immediate/Long text field", - new MethodProperty<Long>(this, "long1")); - f1.setImmediate(false); - f1.setNullSettingAllowed(true); - TextField f2 = new TextField("Immediate/Long text field", - new MethodProperty<Long>(this, "long2")); - f2.setImmediate(true); - f2.setNullSettingAllowed(true); - - layout.addComponent(f1); - layout.addComponent(f2); - - w.setContent(layout); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2007.java b/uitest/src/com/vaadin/tests/tickets/Ticket2007.java deleted file mode 100644 index 7d157c663c..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2007.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2007 extends LegacyApplication { - - int childs = 0; - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow("Main window for #2007"); - setMainWindow(main); - main.addComponent(new Button("Open another (non-main) window", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - LegacyWindow c = new LegacyWindow( - "Non-main browser window " + (++childs)); - addWindow(c); - main.open(new ExternalResource(c.getURL()), "_new"); - } - })); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2009.java b/uitest/src/com/vaadin/tests/tickets/Ticket2009.java deleted file mode 100644 index 64881c046a..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2009.java +++ /dev/null @@ -1,137 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Container; -import com.vaadin.event.ItemClickEvent; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2009 extends com.vaadin.server.LegacyApplication { - - TextField f = new TextField(); - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - HorizontalLayout ol = new HorizontalLayout(); - main.setContent(ol); - ol.setSizeFull(); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel("Tree test", pl); - p.setSizeFull(); - - Tree t = new Tree(); - - t.addItem("Foo"); - t.addItem("Bar"); - - final VerticalLayout events = new VerticalLayout(); - - t.addListener(new ItemClickEvent.ItemClickListener() { - @Override - public void itemClick(ItemClickEvent event) { - events.addComponent(new Label(new Label("Click:" - + (event.isDoubleClick() ? "double" : "single") - + " button:" + event.getButtonName() + " propertyId:" - + event.getPropertyId() + " itemID:" - + event.getItemId() + " item:" + event.getItem()))); - - } - }); - - main.addComponent(p); - pl.addComponent(t); - pl.addComponent(events); - - VerticalLayout p2l = new VerticalLayout(); - p2l.setMargin(true); - Panel p2 = new Panel("Table test (try dbl click also)", p2l); - p2.setSizeFull(); - - final VerticalLayout events2 = new VerticalLayout(); - Table table = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(5, 100); - table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(new ItemClickEvent.ItemClickListener() { - @Override - public void itemClick(ItemClickEvent event) { - events2.addComponent(new Label("Click:" - + (event.isDoubleClick() ? "double" : "single") - + " button:" + event.getButtonName() + " propertyId:" - + event.getPropertyId() + " itemID:" - + event.getItemId() + " item:" + event.getItem())); - if (event.isDoubleClick()) { - new PropertyEditor(event); - } - - } - }); - p2l.addComponent(table); - p2l.addComponent(events2); - - main.addComponent(p2); - - } - - class PropertyEditor extends Window { - - private static final int W = 300; - private static final int H = 150; - - private Container c; - private Object itemid; - private Object propertyid; - - TextField editor = new TextField(); - Button done = new Button("Done"); - - PropertyEditor(ItemClickEvent event) { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - setContent(layout); - c = (Container) event.getSource(); - - propertyid = event.getPropertyId(); - itemid = event.getItemId(); - - setCaption("Editing " + itemid + " : " + propertyid); - - editor.setPropertyDataSource(c.getContainerProperty(itemid, - propertyid)); - layout.addComponent(editor); - layout.addComponent(done); - - setWidth(W + "px"); - setHeight(H + "px"); - - setPositionX(event.getClientX() - W / 2); - setPositionY(event.getClientY() - H / 2); - - getMainWindow().addWindow(this); - - done.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - getMainWindow().removeWindow(PropertyEditor.this); - } - }); - - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2011.java b/uitest/src/com/vaadin/tests/tickets/Ticket2011.java deleted file mode 100644 index 3ca09a2d80..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2011.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Select; - -public class Ticket2011 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - // setTheme("tests-ticket"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Select s = new Select("Select"); - s.addItem("Item 1"); - s.addItem("Item 2"); - layout.addComponent(s); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2014.java b/uitest/src/com/vaadin/tests/tickets/Ticket2014.java deleted file mode 100644 index 7fdd56df67..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2014.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.UUID; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2014 extends LegacyApplication { - - private HorizontalLayout innerLayout1; - private Button b1; - private Panel panel; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getName()); - setMainWindow(w); - // setTheme("tests-ticket"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - createPanel(layout); - - layout.addComponent(new Button("Change class name", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - b1.setStyleName(UUID.randomUUID().toString()); - } - - })); - - } - - private void createPanel(GridLayout layout) { - VerticalLayout panelLayout = new VerticalLayout(); - panelLayout.setMargin(true); - panel = new Panel("panel caption", panelLayout); - layout.addComponent(panel); - - innerLayout1 = new HorizontalLayout(); - innerLayout1.setSpacing(true); - panelLayout.addComponent(innerLayout1); - - b1 = new Button("Button inside orderedLayout", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - System.out.println("Clicked " + event.getButton().getCaption()); - } - - }); - - innerLayout1.addComponent(b1); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2021.java b/uitest/src/com/vaadin/tests/tickets/Ticket2021.java deleted file mode 100644 index c6cbdbfa94..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2021.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractComponent; -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.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2021 extends LegacyApplication { - - private TextArea tf1, tf2, tf3; - - 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."; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - w.setContent(new GridLayout(2, 2)); - setMainWindow(w); - - VerticalLayout layout = new VerticalLayout(); - Panel p = new Panel(layout); - p.setCaption("ExpandLayout"); - p.setWidth("500px"); - p.setHeight("500px"); - layout.setSizeFull(); - - w.addComponent(p); - - tf1 = new TextArea(); - tf1.setRows(5); - tf1.setSizeFull(); - tf1.setValue(contents); - tf1.setCaption("TextField caption"); - layout.addComponent(tf1); - - /* - * - * OrderedLayout - */ - - VerticalLayout layout2 = new VerticalLayout(); - Panel p2 = new Panel(layout2); - p2.setCaption("OrderedLayout"); - p2.setWidth("500px"); - p2.setHeight("500px"); - layout2.setSizeFull(); - - w.addComponent(p2); - - tf2 = new TextArea(); - tf2.setRows(5); - tf2.setSizeFull(); - tf2.setValue(contents); - tf2.setCaption("TextField caption"); - layout2.addComponent(tf2); - - /* - * - * GridLayout - */ - - VerticalLayout p3l = new VerticalLayout(); - p3l.setMargin(true); - Panel p3 = new Panel(p3l); - p3.setCaption("GridLayout"); - p3.setWidth("500px"); - p3.setHeight("500px"); - // p3.setContent(new GridLayout()); - p3l.setSizeFull(); - p3l.setMargin(false); - - GridLayout gl = new GridLayout(); - gl.setSizeFull(); - gl.setMargin(false); - p3l.addComponent(gl); - w.addComponent(p3); - - tf3 = new TextArea(); - tf3.setRows(5); - tf3.setSizeFull(); - tf3.setValue(contents); - tf3.setCaption("TextField caption"); - // p3.getContent().addComponent(tf3); - gl.addComponent(tf3); - - // Panel pp = new Panel(); - // pp.setCaption("OrderedLayout"); - // pp.setWidth("500px"); - // pp.setHeight("500px"); - // pp.getContent().setSizeFull(); - // orderedLayout = new VerticalLayout(); - // pp.getContent().addComponent(orderedLayout); - // w.getContent().addComponent(pp); - // createUI(orderedLayout); - } - - @SuppressWarnings("unused") - private void createUI(Layout layout) { - Label l = new Label("Label"); - Button b = new Button("Enable/disable caption and watch button move", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - System.out.println("Enable/disable caption"); - for (AbstractComponent l : new AbstractComponent[] { - tf1, tf2, tf3 }) { - // AbstractComponent l = tf2; - // Layout l = (Layout) event.getButton().getData(); - if (l.getCaption() == null) { - l.setCaption("Expand layout caption"); - } else { - l.setCaption(null); - } - } - } - - }); - b.setData(layout); - Label l2 = new Label("This should always be visible"); - - layout.addComponent(l); - layout.addComponent(b); - layout.addComponent(l2); - - if (layout instanceof AbstractOrderedLayout) { - ((AbstractOrderedLayout) layout).setExpandRatio(l, 1); - - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2022.java b/uitest/src/com/vaadin/tests/tickets/Ticket2022.java deleted file mode 100644 index 8631f8ea93..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2022.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2022 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - CustomLayout l; - - // WebApplicationContext wac = ((WebApplicationContext) getContext()); - // File f = new File(wac.getBaseDirectory().getAbsoluteFile() - // + "/VAADIN/themes/" + getTheme() + "/layouts/Ticket2022.html"); - - l = new CustomLayout("Ticket2022"); - // try { - // l = new CustomLayout(new FileInputStream(f)); - w.setContent(l); - // } catch (FileNotFoundException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } catch (IOException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2023.java b/uitest/src/com/vaadin/tests/tickets/Ticket2023.java deleted file mode 100644 index 7c79f86fb2..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2023.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2023 extends com.vaadin.server.LegacyApplication implements - Button.ClickListener { - - AbstractComponent c = new Button(); - - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - String[] sizes = { "20", "100", "1", "0", "-1", "", "z" }; - String[] units = { "%", "px", "em", "ex", "in", "cm", "mm", "pt", "pc", - "", "p", "zyx" }; - - GridLayout gl = new GridLayout(units.length, sizes.length); - main.addComponent(gl); - for (int i = 0; i < sizes.length; i++) { - for (int j = 0; j < units.length; j++) { - String s = sizes[i] + units[j]; - gl.addComponent(new Button(s, this)); - } - } - - gl.addComponent(new Button("null", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - c.setWidth(null); - c.setHeight(null); - - } - - })); - - main.addComponent(c); - - } - - @Override - public void buttonClick(ClickEvent event) { - c.setWidth(event.getButton().getCaption()); - c.setHeight(event.getButton().getCaption()); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2024.java b/uitest/src/com/vaadin/tests/tickets/Ticket2024.java deleted file mode 100644 index 2861c9beca..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2024.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2024 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(2, 2); - layout.setHeight("100%"); - layout.setWidth("700"); - w.getContent().setSizeFull(); - w.getContent().setHeight("2000"); - w.addComponent(layout); - - layout.addComponent(new Label( - "This should NOT get stuck when scrolling down")); - layout.addComponent(new TextField("This should not get stuck either...")); - - VerticalLayout ol = new VerticalLayout(); - ol.setHeight("1000"); - ol.setWidth("200"); - w.addComponent(ol); - ol.addComponent(new Label("Just a label to enable the scrollbar")); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2026.java b/uitest/src/com/vaadin/tests/tickets/Ticket2026.java deleted file mode 100644 index 59efa74df8..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2026.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket2026 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - GridLayout layout = new GridLayout(2, 2); - layout.setSpacing(true); - - @SuppressWarnings("unused") - int nr = 5; - TextField tf; - tf = new TextField("TextField (tabIndex 1)"); - tf.setTabIndex(1); - tf.focus(); - layout.addComponent(tf); - layout.addComponent(new TextField("TextField without tab index")); - layout.addComponent(new TextField("TextField without tab index")); - layout.addComponent(new TextField("TextField without tab index")); - layout.addComponent(new TextField("TextField without tab index")); - tf = new TextField("TextField (tabIndex 2)"); - tf.setTabIndex(2); - layout.addComponent(tf); - - w.setContent(layout); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2029.java b/uitest/src/com/vaadin/tests/tickets/Ticket2029.java deleted file mode 100644 index 6c2418c387..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2029.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Random; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.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.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2029 extends LegacyApplication { - - int COMPONENTS; - int DIM1, DIM2; - Random r = new Random(); - - @Override - public void init() { - COMPONENTS = 5; - DIM1 = 504; - DIM2 = 100; - - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - Panel p = createPanel(); - w.addComponent(p); - // w.getLayout().addComponent(createGLPanel()); - w.addComponent(createPanelV()); - } - - private Panel createPanel() { - Panel p = new Panel(DIM1 + "x" + DIM2 + " OrderedLayout"); - p.setWidth(DIM1 + "px"); - p.setHeight(DIM2 + "px"); - - HorizontalLayout layout = new HorizontalLayout(); - p.setContent(layout); - layout.setSizeFull(); - - for (int i = 0; i < COMPONENTS; i++) { - TextField tf = new TextField(); - if (r.nextBoolean()) { - tf.setCaption("Caption"); - } - if (r.nextBoolean()) { - tf.setRequired(true); - } - if (r.nextBoolean()) { - tf.setComponentError(new UserError("Error")); - } - tf.setWidth("100%"); - layout.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - layout.addComponent(tf); - - } - - return p; - } - - @SuppressWarnings("unused") - private Panel createGLPanel() { - Panel p = new Panel("" + DIM1 + "x" + DIM2 + " GridLayout"); - p.setWidth("" + DIM1 + "px"); - p.setHeight("" + DIM2 + "px"); - - GridLayout layout = new GridLayout(COMPONENTS, 1); - p.setContent(layout); - layout.setSizeFull(); - - for (int i = 0; i < COMPONENTS; i++) { - TextField tf = new TextField(); - tf.setImmediate(true); - tf.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - Component c = ((Component) event.getProperty()); - c.setCaption("askfdj"); - - } - }); - if (r.nextBoolean()) { - tf.setCaption("Caption"); - } - if (r.nextBoolean()) { - tf.setRequired(true); - } - if (r.nextBoolean()) { - tf.setComponentError(new UserError("Error")); - } - tf.setWidth("100%"); - layout.setComponentAlignment(tf, Alignment.MIDDLE_LEFT); - layout.addComponent(tf); - - } - - return p; - } - - private Panel createPanelV() { - Panel p = new Panel("" + DIM1 + "x" + DIM2 + " OrderedLayout"); - p.setWidth("" + DIM2 + "px"); - p.setHeight("" + DIM1 + "px"); - - VerticalLayout layout = new VerticalLayout(); - p.setContent(layout); - layout.setSizeFull(); - - for (int i = 0; i < COMPONENTS; i++) { - TextArea tf = new TextArea(); - if (r.nextBoolean()) { - tf.setCaption("Caption"); - } - if (r.nextBoolean()) { - tf.setRequired(true); - } - if (r.nextBoolean()) { - tf.setComponentError(new UserError("Error")); - } - - tf.setRows(2); - tf.setSizeFull(); - - layout.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - layout.addComponent(tf); - - } - - return p; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2037.java b/uitest/src/com/vaadin/tests/tickets/Ticket2037.java deleted file mode 100644 index e7af6a7c55..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2037.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2037 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - main.addComponent(new Label( - "Use debug dialog and trac number of registered paintables. It should not grow on subsequant b clicks.")); - - final Layout lo = new VerticalLayout(); - - Button b = new Button("b"); - - main.addComponent(b); - main.addComponent(lo); - b.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - - repopupate(lo); - - } - }); - - } - - int counter = 0; - - protected void repopupate(Layout lo) { - lo.removeAllComponents(); - - for (int i = 0; i < 20; i++) { - lo.addComponent(new Label("tc" + (counter++))); - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2038.java b/uitest/src/com/vaadin/tests/tickets/Ticket2038.java deleted file mode 100644 index 12866da570..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2038.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Notification; -import com.vaadin.ui.TextField; - -public class Ticket2038 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow w = new LegacyWindow("Testing for #2038"); - setMainWindow(w); - - final TextField tf = new TextField( - "Test-field, enter someting and click outside the field to activate"); - tf.setRequired(true); - tf.setImmediate(true); - tf.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - w.showNotification("TextField is " + (tf.isValid() ? "" : "in") - + "valid, with error: " + tf.getErrorMessage(), - Notification.TYPE_WARNING_MESSAGE); - } - }); - w.addComponent(tf); - - final CheckBox b = new CheckBox( - "Field should use error message. (!) should be shown when invalid.", - false); - w.addComponent(b); - b.setImmediate(true); - b.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - tf.setRequiredError(b.getValue() ? "Field must not be empty" - : null); - } - }); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2040.java b/uitest/src/com/vaadin/tests/tickets/Ticket2040.java deleted file mode 100644 index 5113c2e9c3..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2040.java +++ /dev/null @@ -1,87 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.TextField; - -public class Ticket2040 extends com.vaadin.server.LegacyApplication { - - TextField f = new TextField(); - - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - main.getContent().setSizeFull(); - ((MarginHandler) main.getContent()).setMargin(true); - - setTheme("tests-tickets"); - - Accordion ts; - - ts = new Accordion(); - ts.setSizeFull(); - ts.setWidth("300px"); - - TextArea l = new TextArea("DSFS"); - l.setRows(2); - l.setStyleName("red"); - l.setSizeFull(); - ts.addTab(l, "100% h component", null); - - Label testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - // main.addComponent(ts); - - ts = new Accordion(); - ts.setSizeFull(); - ts.setHeight("200px"); - ts.setWidth("300px"); - - l = new TextArea("DSFS"); - l.setRows(2); - l.setStyleName("red"); - l.setSizeFull(); - ts.addTab(l, "200px h component", null); - - testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - main.addComponent(ts); - - ts = new Accordion(); - ts.setSizeFull(); - ts.setHeight("50%"); - ts.setWidth("300px"); - - l = new TextArea("DSFS"); - l.setRows(2); - l.setStyleName("red"); - l.setSizeFull(); - ts.addTab(l, "50% h component", null); - - testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - // main.addComponent(ts); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2042.java b/uitest/src/com/vaadin/tests/tickets/Ticket2042.java deleted file mode 100644 index 56431258c0..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2042.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Notification; - -public class Ticket2042 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(1, 2); - layout.setHeight("2000px"); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - layout.addComponent(new Label("abc")); - layout.addComponent(new Button("B", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Notification n = new Notification("Test"); - getMainWindow().showNotification(n); - } - - })); - - layout.addComponent(new Label("abc")); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2043.java b/uitest/src/com/vaadin/tests/tickets/Ticket2043.java deleted file mode 100644 index 2ebcae1d33..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2043.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.BorderStyle; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Link; - -public class Ticket2043 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Link l = new Link("Vaadin home (new 200x200 window, no decor, icon)", - new ExternalResource("http://www.vaadin.com"), "_blank", 200, - 200, BorderStyle.NONE); - - layout.addComponent(l); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2048.java b/uitest/src/com/vaadin/tests/tickets/Ticket2048.java deleted file mode 100644 index 8fa7c296d0..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2048.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2048 extends LegacyApplication { - - private Embedded embedded; - private Panel p; - private VerticalLayout orderedLayout; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - // splitPanel = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - // getMainWindow().setContent(splitPanel); - - // GridLayout layout = new GridLayout(10, 10); - // w.setContent(layout); - // gridLayout = new GridLayout(1, 1); - orderedLayout = new VerticalLayout(); - - getMainWindow().setContent(orderedLayout); - // getMainWindow().setContent(new GridLayout(1, 1)); - getMainWindow().setSizeFull(); - getMainWindow().getContent().setSizeFull(); - - createUI(orderedLayout); - // createUI(gridLayout); - - } - - private void createUI(Layout layout) { - // Button sw = new Button("Switch", new ClickListener() { - // - // public void buttonClick(ClickEvent event) { - // Layout l = getMainWindow().getLayout(); - // if (l == orderedLayout) { - // getMainWindow().setContent(gridLayout); - // } else { - // getMainWindow().setContent(orderedLayout); - // } - // - // } - // }); - // layout.addComponent(sw); - - Layout ol = new GridLayout(1, 2); - p = new Panel("Panel", ol); - p.setSizeFull(); - Label l = new Label("Spacer"); - l.setHeight("400px"); - ol.addComponent(l); - - embedded = new Embedded(null, new ThemeResource( - "icons/64/folder-add.png")); - layout.addComponent(embedded); - Button b = new Button( - "Replace image with new embedded component (flashes)", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Embedded newEmbedded = new Embedded(null, - new ThemeResource("icons/64/folder-add.png")); - getMainWindow().replaceComponent(embedded, newEmbedded); - embedded = newEmbedded; - - } - - }); - ol.addComponent(b); - - b = new Button("Change image source (is fine)", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - String img = "folder-add"; - if (((ThemeResource) embedded.getSource()).getResourceId() - .contains("folder-add")) { - img = "folder-delete"; - } - embedded.setSource(new ThemeResource("icons/64/" + img + ".png")); - - } - - }); - - ol.addComponent(b); - layout.addComponent(p); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2051.java b/uitest/src/com/vaadin/tests/tickets/Ticket2051.java deleted file mode 100644 index 172ced73cc..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2051.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.DateField; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; - -public class Ticket2051 extends LegacyApplication { - - private static final Object P1 = new Object(); - private static final Object P2 = new Object(); - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Table t = new Table("This is a table"); - t.addContainerProperty(P1, Component.class, null); - t.addContainerProperty(P2, Component.class, null); - t.setColumnHeaders(new String[] { "Col1", "Col2" }); - - Item i = t.addItem("1"); - i.getItemProperty(P1).setValue(new TextField("abc")); - i.getItemProperty(P2).setValue(new Label("label")); - Item i2 = t.addItem("2"); - i2.getItemProperty(P1).setValue(new Button("def")); - i2.getItemProperty(P2).setValue(new DateField()); - - layout.addComponent(t); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2053.java b/uitest/src/com/vaadin/tests/tickets/Ticket2053.java deleted file mode 100644 index 14c8273c0d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2053.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket2053 extends LegacyApplication { - - int childs = 0; - - @Override - public void init() { - - final LegacyWindow main = new LegacyWindow("#2053"); - setMainWindow(main); - Button nothing = new Button("Do nothing"); - main.addComponent(nothing); - nothing.setDescription("Even though no action is taked, this window is refreshed to " - + "draw changes not originating from this window. Such changes include changes " - + "made by other browser-windows."); - Button add = new Button("Add a window", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - final String name = "Child " + (++childs); - LegacyWindow c = new LegacyWindow(name); - - addWindow(c); - main.open(new ExternalResource(c.getURL()), "_new"); - main.addComponent(new Label(name + " opened")); - final TextField tf = new TextField("Non immediate textfield"); - c.addComponent(tf); - tf.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - main.addComponent(new Label(name + " send text:" - + tf.getValue())); - } - }); - for (int i = 0; i < 3; i++) { - final String caption = "Slow button " + i; - c.addComponent(new Button(caption, - new Button.ClickListener() { - @Override - public synchronized void buttonClick( - ClickEvent event) { - try { - this.wait(2000); - } catch (InterruptedException e) { - } - main.addComponent(new Label(caption - + " pressed")); - } - })); - } - - } - }); - main.addComponent(add); - add.setDescription("This button opens a new browser window. Closing the browser " - + "window should do two things: 1) submit all unsubmitted state to server " - + "(print any changes to textfield to main window) and 2) call window.close()" - + " on the child window (print closed on the main window)"); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2060.java b/uitest/src/com/vaadin/tests/tickets/Ticket2060.java deleted file mode 100644 index 8996639226..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2060.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2060 extends LegacyApplication { - - private Button button1; - private Button button2; - private Button button3; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - HorizontalLayout buttonLayout = new HorizontalLayout(); - button1 = new Button("Button which is 50px wide"); - button1.setWidth("50px"); - button2 = new Button("Button without width"); - button3 = new Button("Click to repaint buttons", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - button1.markAsDirty(); - button2.markAsDirty(); - button3.markAsDirty(); - - } - - }); - - buttonLayout.addComponent(button1); - buttonLayout.addComponent(button2); - buttonLayout.addComponent(button3); - - layout.addComponent(buttonLayout); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2061.java b/uitest/src/com/vaadin/tests/tickets/Ticket2061.java deleted file mode 100644 index 3838986bfa..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2061.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.vaadin.tests.tickets; - -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.server.LegacyApplication; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2061 extends LegacyApplication { - - private LegacyWindow mainWindow; - - @Override - public void init() { - mainWindow = new LegacyWindow("Ticket 2061"); - mainWindow.setSizeFull(); - mainWindow.getContent().setSizeFull(); - setMainWindow(mainWindow); - - MyTable table1 = new MyTable(24, "table1"); - table1.loadTable(1000); - - MyTable table2 = new MyTable(24, "table2"); - table2.loadTable(1000); - - MyTable table3 = new MyTable(24, "table3"); - table3.loadTable(1000); - - MyAccordion accordion = new MyAccordion(new Component[] { table1, - table2 }, "Test"); - - Tabs tab = new Tabs(new Component[] { accordion, table3 }); - - mainWindow.addComponent(tab); - - } - - public class MyTable extends CustomComponent implements ValueChangeListener { - - private Table table = new Table(); - private String[] columns; - private VerticalLayout layout = new VerticalLayout(); - - public MyTable(int columnNumber, String id) { - setId(id); - setCompositionRoot(layout); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(this); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - @Override - public void valueChange(ValueChangeEvent event) { - - } - - } - - public class Tabs extends TabSheet { - - public Tabs(Component[] components) { - this.setWidth("100%"); - this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - - } - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2061b.java b/uitest/src/com/vaadin/tests/tickets/Ticket2061b.java deleted file mode 100644 index 22c7471282..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2061b.java +++ /dev/null @@ -1,208 +0,0 @@ -package com.vaadin.tests.tickets; - -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.server.LegacyApplication; -import com.vaadin.server.Sizeable; -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.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; -import com.vaadin.ui.TabSheet.SelectedTabChangeListener; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.VerticalSplitPanel; - -public class Ticket2061b extends LegacyApplication implements - SelectedTabChangeListener { - - private LegacyWindow mainWindow; - private Panel p; - - @Override - public void init() { - mainWindow = new LegacyWindow("Ticket 2061b"); - mainWindow.setSizeFull(); - AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow - .getContent(); - mainLayout.setSizeFull(); - mainLayout.setMargin(false); - setMainWindow(mainWindow); - - VerticalSplitPanel sp = new VerticalSplitPanel(); - sp.setSizeFull(); - sp.setSplitPosition(20, Sizeable.UNITS_PIXELS); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("This is a panel", pl); - p.setSizeFull(); - Label label1 = new Label("This is a table!"); - label1.setHeight("1500px"); - label1.setWidth("1500px"); - pl.addComponent(label1); - p.setScrollTop(50); - // MyTable table1 = new MyTable(24, "table1"); - // table1.loadTable(1000); - - // MyTable table2 = new MyTable(24, "table2"); - // table2.loadTable(1000); - - // MyTable table3 = new MyTable(24, "table3"); - // table3.loadTable(1000); - - // MyAccordion accordion = new MyAccordion(new Component[] { table1, - // table2 }, "Test"); - - Label a = new Label("abc123"); - TextField tf = new TextField("A large textfield"); - tf.setHeight("2500px"); - tf.setWidth("2500px"); - - TabsAcc tab = new TabsAcc(new Component[] { p, a, tf }); - tab.addListener(this); - - mainLayout.addComponent(sp); - sp.addComponent(new Label("C 1")); - // sp.addComponent(new Label("C 2")); - // sp.setHeight("100px"); - - sp.addComponent(tab); - // mainLayout.addComponent(new Label("Filler")); - // mainLayout.addComponent(tab); - // mainLayout.setExpandRatio(tab, 1.0f); - // sp.addComponent(new Label("Filler")); - // sp.addComponent(tab); - - pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("This is a panel", pl); - p.setWidth("2000px"); - p.setHeight("2000px"); - VerticalLayout p2l = new VerticalLayout(); - p2l.setMargin(true); - Panel p2 = new Panel("This is another panel", p2l); - p2.setWidth("2500px"); - p2.setHeight("2500px"); - label1 = new Label("This is a table!"); - label1.setHeight("1500px"); - label1.setWidth("1500px"); - p2l.addComponent(label1); - pl.addComponent(p2); - - tab.addTab(p, "Panel with panel", null); - } - - public class MyTable extends CustomComponent implements ValueChangeListener { - - private Table table = new Table(); - private String[] columns; - private VerticalLayout layout = new VerticalLayout(); - - public MyTable(int columnNumber, String id) { - setId(id); - setCompositionRoot(layout); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(this); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - @Override - public void valueChange(ValueChangeEvent event) { - - } - - } - - public class Tabs extends TabSheet { - - public Tabs(Component[] components) { - this.setWidth("100%"); - this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - - } - - } - - public class TabsAcc extends Accordion { - - public TabsAcc(Component[] components) { - this.setWidth("100%"); - this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - - } - - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - } - } - - @Override - public void selectedTabChange(SelectedTabChangeEvent event) { - p.setScrollTop(10); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2061c.java b/uitest/src/com/vaadin/tests/tickets/Ticket2061c.java deleted file mode 100644 index e6255d71c7..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2061c.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.vaadin.tests.tickets; - -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.server.LegacyApplication; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; -import com.vaadin.ui.TabSheet.SelectedTabChangeListener; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2061c extends LegacyApplication implements - SelectedTabChangeListener { - - private LegacyWindow mainWindow; - private Panel p; - - @Override - public void init() { - mainWindow = new LegacyWindow("Vaadin"); - mainWindow.setSizeFull(); - mainWindow.getContent().setSizeFull(); - setMainWindow(mainWindow); - - VerticalLayout ol = new VerticalLayout(); - ol.setWidth("200px"); - ol.setHeight("200px"); - - VerticalLayout ol2 = new VerticalLayout(); - ol2.setSizeFull(); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - p = new Panel("This is a panel", pl); - p.setSizeFull(); - - Label label1 = new Label("This is a table!"); - label1.setHeight("1500px"); - label1.setWidth("1500px"); - p.setScrollTop(50); - - pl.addComponent(label1); - ol2.addComponent(p); - ol.addComponent(ol2); - - Label a = new Label("abc123"); - a.setCaption("Label a"); - ol.setCaption("OL"); - Tabs tab = new Tabs(new Component[] { a, ol }); - tab.addListener(this); - mainWindow.addComponent(tab); - - } - - public class MyTable extends CustomComponent implements ValueChangeListener { - - private Table table = new Table(); - private String[] columns; - private VerticalLayout layout = new VerticalLayout(); - - public MyTable(int columnNumber, String id) { - setId(id); - setCompositionRoot(layout); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(this); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - @Override - public void valueChange(ValueChangeEvent event) { - - } - - } - - public class Tabs extends TabSheet { - - public Tabs(Component[] components) { - this.setWidth("100%"); - // this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - } - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - } - } - - @Override - public void selectedTabChange(SelectedTabChangeEvent event) { - p.setScrollTop(10); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2062.java b/uitest/src/com/vaadin/tests/tickets/Ticket2062.java deleted file mode 100644 index 0402b4cbd5..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2062.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; - -public class Ticket2062 extends LegacyApplication { - private static final Object P1 = new Object(); - - @Override - public void init() { - setMainWindow(new LegacyWindow("Ticket2062")); - getMainWindow().setSizeFull(); - - HorizontalSplitPanel p = new HorizontalSplitPanel(); - p.setSizeFull(); - getMainWindow().setContent(p); - - TextField tf1 = new TextField("Tab 1"); - tf1.setValue("Field 1"); - tf1.setSizeFull(); - - Table t = new Table("Table"); - t.addContainerProperty(P1, String.class, ""); - t.setSizeFull(); - - TabSheet tabSheet = new TabSheet(); - tabSheet.setWidth("300px"); - tabSheet.setHeight("300px"); - - tabSheet.addComponent(tf1); - tabSheet.addComponent(t); - - getMainWindow().addComponent(tabSheet); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2083.java b/uitest/src/com/vaadin/tests/tickets/Ticket2083.java deleted file mode 100644 index a94dafafcb..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2083.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2083 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel( - "This is a panel with a longer caption than it should have", pl); - p.setWidth("100px"); - pl.addComponent(new Label("Contents")); - layout.addComponent(p); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2090.java b/uitest/src/com/vaadin/tests/tickets/Ticket2090.java deleted file mode 100644 index ed79a60794..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2090.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.UserError; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket2090 extends LegacyApplication { - - Label label = new Label(); - Button target = new Button(); - LegacyWindow w = new LegacyWindow("#2090"); - - @Override - public void init() { - setMainWindow(w); - final TextField width = new TextField("Width"); - width.setImmediate(true); - final TextField height = new TextField("Height"); - height.setImmediate(true); - w.addComponent(width); - w.addComponent(height); - w.addComponent(label); - w.addComponent(target); - height.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - try { - target.setHeight(height.getValue()); - height.setComponentError(null); - updateLabel(); - } catch (Exception e) { - height.setComponentError(new UserError(e.getMessage())); - } - } - }); - width.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - try { - target.setWidth(width.getValue()); - width.setComponentError(null); - updateLabel(); - } catch (Exception e) { - width.setComponentError(new UserError(e.getMessage())); - } - } - }); - - } - - private void updateLabel() { - label.setValue("width: " + target.getWidth() - + target.getWidthUnits().getSymbol() + ", height: " - + target.getHeight() + target.getHeightUnits().getSymbol()); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2095.java b/uitest/src/com/vaadin/tests/tickets/Ticket2095.java deleted file mode 100644 index 270da9dc3f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2095.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2095 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - // uncomment to workaround iorderedlayout bug in current trunk - // w.setContent(new ExpandLayout()); - w.getContent().setSizeFull(); - - Embedded em = new Embedded(); - em.setType(Embedded.TYPE_BROWSER); - em.setSource(new ExternalResource("../statictestfiles/ticket2095.html")); - em.setId("MYIFRAME"); - - em.setSizeFull(); - - w.addComponent(em); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2098.java b/uitest/src/com/vaadin/tests/tickets/Ticket2098.java deleted file mode 100644 index 983824daa9..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2098.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; - -public class Ticket2098 extends LegacyApplication { - - private static final String info = "First tab hidden, second should initially be selected"; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - w.addComponent(new Label(info)); - createUI(w); - } - - private void createUI(LegacyWindow w) { - TabSheet ts = new TabSheet(); - Label l1 = new Label("111"); - Label l2 = new Label("222"); - Label l3 = new Label("333"); - Label l4 = new Label("444"); - - ts.addTab(l1, "1", null); - ts.addTab(l2, "2", null); - ts.addTab(l3, "3", null); - ts.addTab(l4, "4", null); - - l1.setVisible(false); - - w.addComponent(ts); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2099.java b/uitest/src/com/vaadin/tests/tickets/Ticket2099.java deleted file mode 100644 index 0dc65cc25e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2099.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2099 extends LegacyApplication { - - private Label l1, l2, l3; - private VerticalLayout ol1, ol2, ol3; - private Window popup; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setContent(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Button b = new Button("Show popup", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - getMainWindow().addWindow(popup); - // popup.setVisible(true); - } - - }); - popup = createPopup(); - getMainWindow().addWindow(popup); - - layout.addComponent(b); - layout.addComponent(new Button("Hide label '222'", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - l2.setVisible(!l2.isVisible()); - } - - })); - - } - - private Window createPopup() { - Window w = new Window("Popup"); - TabSheet ts = new TabSheet(); - ol1 = new VerticalLayout(); - ol2 = new VerticalLayout(); - ol3 = new VerticalLayout(); - l1 = new Label("111"); - l2 = new Label("222"); - l3 = new Label("333"); - - ol1.addComponent(l1); - ol2.addComponent(l2); - ol3.addComponent(l3); - - ts.addTab(ol1, "1", null); - ts.addTab(ol2, "2", null); - ts.addTab(ol3, "3", null); - - // l1.setVisible(false); - // ts.setSelectedTab(l3); - - w.setContent(ts); - - return w; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2101.java b/uitest/src/com/vaadin/tests/tickets/Ticket2101.java deleted file mode 100644 index dd10943108..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2101.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2101 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - Button b = new Button( - "Button with a long text which will not fit on 50 pixels"); - b.setWidth("50px"); - - w.addComponent(b); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2103.java b/uitest/src/com/vaadin/tests/tickets/Ticket2103.java deleted file mode 100644 index a21864a67d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2103.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Component; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2103 extends LegacyApplication { - private LegacyWindow mainWindow; - - @Override - public void init() { - mainWindow = new LegacyWindow(getClass().getSimpleName()); - mainWindow.setContent(new VerticalLayout()); - mainWindow.setSizeFull(); - mainWindow.getContent().setSizeFull(); - - MyTable table1 = new MyTable(4, "table1"); - table1.loadTable(100); - MyTable table2 = new MyTable(4, "table2"); - table2.loadTable(100); - - MyAccordion a = new MyAccordion(new Component[] { table1, table2 }, - "FDSF"); - mainWindow.addComponent(a); - setMainWindow(mainWindow); - // mainWindow.addComponent(table1); - - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getId(), null); - } - } - } - - public class MyTable extends Table { - - private Table table = this; - private String[] columns; - private VerticalLayout layout = new VerticalLayout(); - - public MyTable(int columnNumber, String id) { - setId(id); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2104.java b/uitest/src/com/vaadin/tests/tickets/Ticket2104.java deleted file mode 100644 index da9f7fecc8..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2104.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.event.ItemClickEvent; -import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.Tree; - -public class Ticket2104 extends LegacyApplication { - - private static final Label info = new Label( - "Click event should _always_ come trough. Switching features on/off should immediatly affect the tree (verify w/ debug window)", - ContentMode.RAW); - - Tree tree = new Tree(); - Table table = new Table(); - - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - main.addComponent(info); - - HorizontalLayout ol = new HorizontalLayout(); - main.addComponent(ol); - CheckBox cb = new CheckBox("immediate", new MethodProperty<Boolean>( - tree, "immediate")); - cb.setImmediate(true); - ol.addComponent(cb); - cb = new CheckBox("selectable", new MethodProperty<Boolean>(tree, - "selectable")); - cb.setImmediate(true); - ol.addComponent(cb); - cb = new CheckBox("nullsel", new MethodProperty<Boolean>(tree, - "nullSelectionAllowed")); - cb.setImmediate(true); - ol.addComponent(cb); - cb = new CheckBox("multi", new MethodProperty<Boolean>(tree, - "multiSelect")); - cb.setImmediate(true); - ol.addComponent(cb); - cb = new CheckBox("icon"); - cb.addListener(new ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - if (tree.getItemIconPropertyId() == null) { - tree.setItemIconPropertyId("icon"); - } else { - tree.setItemIconPropertyId(null); - } - - } - }); - cb.setImmediate(true); - ol.addComponent(cb); - - main.addComponent(tree); - tree.setImmediate(true); - tree.setNullSelectionAllowed(false); - tree.addItem("UI 1"); - tree.addItem("1. Child 1"); - tree.setParent("1. Child 1", "UI 1"); - tree.addItem("1. Child 2"); - tree.setParent("1. Child 2", "UI 1"); - tree.addItem("UI 2"); - tree.addItem("2. Child 1"); - tree.setParent("2. Child 1", "UI 2"); - tree.addItem("2. Child 2"); - tree.setParent("2. Child 2", "UI 2"); - tree.addContainerProperty("icon", ExternalResource.class, - new ExternalResource( - "http://www.itmill.com/res/images/itmill_logo.gif")); - - tree.addListener(new ItemClickListener() { - @Override - public void itemClick(ItemClickEvent event) { - getMainWindow().addComponent( - new Label(event.toString() + " // " + event.getItemId() - + "//" + event.getSource())); - - } - }); - - ol = new HorizontalLayout(); - main.addComponent(ol); - cb = new CheckBox("immediate", new MethodProperty<Boolean>(table, - "immediate")); - cb.setImmediate(true); - ol.addComponent(cb); - cb = new CheckBox("selectable", new MethodProperty<Boolean>(table, - "selectable")); - cb.setImmediate(true); - ol.addComponent(cb); - cb = new CheckBox("nullsel", new MethodProperty<Boolean>(table, - "nullSelectionAllowed")); - cb.setImmediate(true); - ol.addComponent(cb); - cb = new CheckBox("multi", new MethodProperty<Boolean>(table, - "multiSelect")); - cb.setImmediate(true); - ol.addComponent(cb); - main.addComponent(table); - table.setWidth("150px"); - table.setImmediate(true); - table.setSelectable(true); - table.setNullSelectionAllowed(false); - for (int i = 0; i < 10; i++) { - table.addItem("Item " + i); - } - table.addListener(new ItemClickListener() { - @Override - public void itemClick(ItemClickEvent event) { - getMainWindow().addComponent( - new Label(event.toString() + " // " + event.getItemId() - + "//" + event.getSource())); - - } - }); - table.addContainerProperty("Column", String.class, "value"); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2106.java b/uitest/src/com/vaadin/tests/tickets/Ticket2106.java deleted file mode 100644 index 08b7a738a7..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2106.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; - -import com.vaadin.server.CustomizedSystemMessages; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.SystemMessages; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2106 extends LegacyApplication { - - private static CustomizedSystemMessages msgs = new CustomizedSystemMessages(); - static { - // We will forward the user to www.vaadin.com when the session expires - msgs.setSessionExpiredURL("http://www.vaadin.com"); - msgs.setSessionExpiredMessage(null); - msgs.setSessionExpiredCaption(null); - } - - public static SystemMessages getSystemMessages() { - return msgs; - } - - @Override - public void init() { - setMainWindow(new LegacyWindow("#2106")); - getMainWindow().addComponent( - new Button("Do nothing", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - getMainWindow().addComponent( - new Label("Last time did nothing: " - + new Date())); - } - })); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2107.java b/uitest/src/com/vaadin/tests/tickets/Ticket2107.java deleted file mode 100644 index 7de0e2da24..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2107.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Validator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Notification; -import com.vaadin.ui.TextField; - -public class Ticket2107 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow w = new LegacyWindow("Testing for #2107"); - setMainWindow(w); - - final TextField tf = new TextField( - "Required field that validated the input"); - tf.setDescription("Enter someting and click outside the field to activate"); - tf.setRequired(true); - tf.setImmediate(true); - tf.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - w.showNotification("TextField is " + (tf.isValid() ? "" : "in") - + "valid, with error: " + tf.getErrorMessage(), - Notification.TYPE_WARNING_MESSAGE); - } - }); - tf.addValidator(new Validator() { - - @Override - public void validate(Object value) throws InvalidValueException { - if (value == null || value.toString().length() <= 3) { - throw new InvalidValueException( - "Text length must exceed 3 characters"); - } - } - }); - w.addComponent(tf); - - final CheckBox b = new CheckBox( - "Field should use error message. (!) should be shown when empty.", - false); - w.addComponent(b); - b.setImmediate(true); - b.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(ValueChangeEvent event) { - tf.setRequiredError(b.getValue() ? "Field must not be empty" - : null); - } - }); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2117.java b/uitest/src/com/vaadin/tests/tickets/Ticket2117.java deleted file mode 100644 index 9cfa63b29e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2117.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2117 extends LegacyApplication { - - @Override - public void init() { - setMainWindow(createWindow()); - } - - @Override - public LegacyWindow getWindow(String name) { - - // If we already have the requested window, use it - LegacyWindow w = super.getWindow(name); - if (w == null) { - - // If no window found, create it - w = createExtraWindow(name); - w.open(new ExternalResource(w.getURL())); - } - return w; - } - - private LegacyWindow createExtraWindow(String name) { - final LegacyWindow w = new LegacyWindow("Extra window: " + name); - w.setName(name); - addWindow(w); - w.addComponent(new Label( - "This window has been created on fly for name: " + name)); - w.addComponent(new Label("It has also been redirected to " + w.getURL() - + " to support reloading")); - w.addComponent(new Button("button", new ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - w.showNotification("Button clicked"); - w.addComponent(new Label("clicked")); - } - })); - return w; - } - - private LegacyWindow createWindow() { - final LegacyWindow w = new LegacyWindow(); - w.addComponent(new Label( - "Click this link: <a target=\"_blank\" href='" - + getURL().toExternalForm() - + "'>" - + getURL().toExternalForm() - + "</a> which opens new windows to this uri. They should end up having a separate Window and URL.", - ContentMode.HTML)); - return w; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2119.java b/uitest/src/com/vaadin/tests/tickets/Ticket2119.java deleted file mode 100644 index c8002ff2cb..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2119.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Select; -import com.vaadin.ui.VerticalLayout; - -/** - * Test case for Ticket 2119. - */ -public class Ticket2119 extends LegacyApplication { - - private ObjectProperty<String> globalValue; - - @Override - public void init() { - globalValue = new ObjectProperty<String>(null, String.class); - LegacyWindow main = createWindow(); - setMainWindow(main); - } - - @Override - public LegacyWindow getWindow(String name) { - if (!isRunning()) { - return null; - } - // If we already have the requested window, use it - LegacyWindow w = super.getWindow(name); - if (w == null) { - // If no window found, create it - w = createWindow(); - addWindow(w); - w.open(new ExternalResource(w.getURL())); - } - return w; - } - - private LegacyWindow createWindow() { - LegacyWindow main = new LegacyWindow("Test for ticket XXX"); - main.setContent(testLayout()); - return main; - } - - private Layout testLayout() { - final Layout layout = new VerticalLayout(); - final Label label = new Label( - "Instructions to reproduce:\n" - + " - Open this application in two browser windows\n" - + " - Click the Button in first Window\n" - + " - Go to the second Window\n" - + " - Click the arrow in the Select\n" - + " --> The opened list correctly shows the new value but the old one is shown in the \"input\" part"); - label.setContentMode(ContentMode.PREFORMATTED); - layout.addComponent(label); - - final Select select = new Select("Test Select"); - select.setWidth("100px"); - select.setImmediate(true); - select.setNullSelectionAllowed(false); - select.addItem("1"); - select.addItem("2"); - select.addItem("3"); - - final ObjectProperty<String> valueProperty = new ObjectProperty<String>( - "1", String.class); - select.setPropertyDataSource(valueProperty); - layout.addComponent(select); - - globalValue.addListener(new Property.ValueChangeListener() { - @Override - public void valueChange(Property.ValueChangeEvent event) { - Object value = event.getProperty().getValue(); - valueProperty.setValue((null != value) ? value.toString() - : null); - } - }); - - final Button changeValueButton = new Button("Change Value to 2"); - changeValueButton.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - globalValue.setValue("2"); - } - }); - - layout.addComponent(changeValueButton); - - return layout; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2125.java b/uitest/src/com/vaadin/tests/tickets/Ticket2125.java deleted file mode 100644 index ba94bd394d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2125.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.MethodProperty; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.Table.CellStyleGenerator; -import com.vaadin.ui.Table.ColumnGenerator; - -public class Ticket2125 extends LegacyApplication { - - @Override - public void init() { - setMainWindow(new MainWindow("Ticket2125")); - - } - - class MainWindow extends LegacyWindow { - MainWindow(String caption) { - super(caption); - - addComponent(new Label( - "Inspect w/ Firebug: row 5 should have a MYROW -style on the row, and MYCELL on all cells")); - - Table table = new Table(); - table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX); - addComponent(table); - for (int i = 0; i < 50; i++) { - table.addItem(new Integer(i)); - } - table.addContainerProperty("String", String.class, "a string"); - table.addContainerProperty("Boolean", Boolean.class, Boolean.TRUE); - table.addGeneratedColumn("Generated", new ColumnGenerator() { - @Override - public Component generateCell(Table source, Object itemId, - Object columnId) { - return new Label("Item " + itemId); - } - }); - table.setCellStyleGenerator(new CellStyleGenerator() { - @Override - public String getStyle(Table source, Object itemId, - Object propertyId) { - if (new Integer(4).equals(itemId)) { - if (propertyId == null) { - return "MYROW"; - } else { - return "MYCELL"; - } - } - return null; - } - - }); - CheckBox b = new CheckBox("editmode", new MethodProperty<Boolean>( - table, "editable")); - b.setImmediate(true); - addComponent(b); - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2126.java b/uitest/src/com/vaadin/tests/tickets/Ticket2126.java deleted file mode 100644 index bc182181e4..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2126.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -/** - * - * Toggling container with an empty one may result duplicate header cell in - * client. - * - */ -public class Ticket2126 extends com.vaadin.server.LegacyApplication { - - LegacyWindow main = new LegacyWindow(); - Table table = new Table(); - - @Override - public void init() { - setMainWindow(main); - - final IndexedContainer container1 = new IndexedContainer(); - container1.addContainerProperty("text", Component.class, null); - final IndexedContainer container2 = new IndexedContainer(); - - // Case #2 Try to comment the following line for another type of strange - // behaviour - container2.addContainerProperty("text", Component.class, null); - - for (int i = 0; i < 100; i++) { - Item item = container1.addItem(i); - item.getItemProperty("text").setValue(new Label("Test " + i)); - } - - table.setContainerDataSource(container1); - - // workaround for case #2 - // table.setWidth("300px"); - // table.setHeight("300px"); - - Button refreshTable = new Button("Switch table container"); - refreshTable.addListener(new Button.ClickListener() { - boolean full = true; - - @Override - public void buttonClick(Button.ClickEvent e) { - if (full) { - table.setContainerDataSource(container2); - } else { - table.setContainerDataSource(container1); - } - full = !full; - } - }); - - main.addComponent(table); - main.addComponent(refreshTable); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2151.java b/uitest/src/com/vaadin/tests/tickets/Ticket2151.java deleted file mode 100644 index b48a327523..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2151.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2151 extends LegacyApplication { - - private Label status; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - Button b = new Button("This is a button"); - CheckBox cb = new CheckBox("This is a checkbox"); - cb.setImmediate(true); - setTheme("tests-tickets"); - layout.setStyleName("mylayout"); - status = new Label("Result:"); - layout.addComponent(status); - layout.setSpacing(true); - layout.setMargin(true); - - layout.addComponent(b); - layout.addComponent(cb); - - layout.addComponent(new Label("a")); - layout.addComponent(new Label("b")); - layout.addComponent(new Label("c")); - - checkButton(Button.class); - checkCheckBox(CheckBox.class); - checkDataBinding(CheckBox.class); - - } - - private void checkButton(Class<? extends Button> class1) { - boolean ok = false; - AbstractComponent b; - try { - b = class1.newInstance(); - b.setCaption("Button of type " + class1.getSimpleName()); - ok = true; - } catch (Exception e1) { - e1.printStackTrace(); - } - - if (ok) { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + ": OK"); - } else { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + ": FAILED"); - } - - } - - private void checkCheckBox(Class<? extends CheckBox> class1) { - boolean ok = false; - CheckBox b; - try { - b = class1.newInstance(); - } catch (Exception e1) { - e1.printStackTrace(); - return; - } - - b.setCaption("Button of type " + class1.getSimpleName()); - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + ": OK"); - - } - - private void checkDataBinding(Class<? extends AbstractField> class1) { - boolean ok = false; - AbstractField b; - try { - b = class1.newInstance(); - b.setCaption("Button of type " + class1.getSimpleName()); - try { - b.setBuffered(false); - ObjectProperty<String> prop = new ObjectProperty<String>( - "ABC 123"); - /* - * This should throw an exception or somehow tell that the - * property was invalid (wrong type). See #2223. - */ - b.setPropertyDataSource(prop); - } catch (Exception e) { - e.printStackTrace(); - } - } catch (Exception e1) { - e1.printStackTrace(); - return; - } - - if (ok) { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + "/DB: OK"); - } else { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + "/DB: FAILED"); - } - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2157.java b/uitest/src/com/vaadin/tests/tickets/Ticket2157.java deleted file mode 100644 index 89676605ff..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2157.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2157 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - VerticalLayout ol; - Panel p; - ComboBox cb; - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - // cb.setWidth("100%"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - // cb.setWidth("100px"); - ol.addComponent(cb); - layout.addComponent(p); - - // - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide"); - // p.setWidth("500px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("500px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide with caption"); - // p.setWidth("500px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("500px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100%"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide with caption"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100%"); - ol.addComponent(cb); - layout.addComponent(p); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2178.java b/uitest/src/com/vaadin/tests/tickets/Ticket2178.java deleted file mode 100644 index bae6d72974..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2178.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2178 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - VerticalLayout ol; - Panel p; - ComboBox cb; - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - // cb.setWidth("100%"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - // cb.setWidth("100px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide"); - // p.setWidth("500px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("500px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide with caption"); - // p.setWidth("500px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("500px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide inside 200px panel"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100%"); - // cb.setWidth("500px"); - ol.addComponent(cb); - layout.addComponent(p); - - ol = new VerticalLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide inside 200px panel with caption"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100%"); - ol.addComponent(cb); - layout.addComponent(p); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2179.java b/uitest/src/com/vaadin/tests/tickets/Ticket2179.java deleted file mode 100644 index 06fb162f59..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2179.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Validator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket2179 extends LegacyApplication { - - TextField f = new TextField("Test fiel ( must contain 1 & 2 )"); - LegacyWindow main = new LegacyWindow("Dual validator test"); - - @Override - public void init() { - - f.setImmediate(true); - f.setRequired(true); - f.addValidator(new ContainsValidator("1")); - f.addValidator(new ContainsValidator("2")); - - setMainWindow(main); - main.addComponent(f); - - f.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - main.showNotification("Test field is " - + (f.isValid() ? "valid" : "invalid")); - } - }); - - } - - static class ContainsValidator implements Validator { - private final String c; - - public ContainsValidator(String c) { - this.c = c; - } - - @Override - public void validate(Object value) throws InvalidValueException { - if (value == null || !value.toString().contains(c)) { - throw new InvalidValueException("Value does not contain " + c); - } - - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2180.java b/uitest/src/com/vaadin/tests/tickets/Ticket2180.java deleted file mode 100644 index dafebf06f2..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2180.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TabSheet; - -public class Ticket2180 extends LegacyApplication { - - private LegacyWindow mainWindow; - private TabSheet tabSheet; - - @Override - public void init() { - mainWindow = new LegacyWindow("Tabsheet should cause scrollbars"); - setMainWindow(mainWindow); - // mainWindow.getLayout().setSizeFull(); - tabSheet = new TabSheet(); - // tabSheet.setWidth("100%"); - Button button = new Button("Blah"); - button.setWidth("100%"); - Label label1 = new Label("Lorem ipsum"); - Label label2 = new Label("Lorem"); - Label label3 = new Label( - "Lorema jsdfhak sjdfh kajsdh fkajhd kfjah dkfjah ksfdjh kajsfh kj 1 2 3 4 5 6 7 8 9 10"); - - label3.setWidth("800px"); - tabSheet.addTab(label1, "Tab 1", null); - tabSheet.addTab(label2, "Tab 2", null); - tabSheet.addTab(label3, "Tab 3", null); - tabSheet.addTab(new Label("a"), "Tab 4", null); - tabSheet.addTab(new Label("a"), "Tab 5", null); - tabSheet.addTab(new Label("a"), "Tab 6", null); - // mainWindow.addComponent(new Label("123")); - mainWindow.addComponent(tabSheet); - mainWindow.addComponent(button); - // mainWindow.addComponent(new Label("abc")); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2181.java b/uitest/src/com/vaadin/tests/tickets/Ticket2181.java deleted file mode 100644 index beefb9b719..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2181.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Date; -import java.util.Random; -import java.util.Set; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.ThemeResource; -import com.vaadin.server.UserError; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Component; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2181 extends LegacyApplication implements - Button.ClickListener { - - // private static final Object PROPERTY_VALUE = new Object(); - // private static final Object PROPERTY_CAPTION = new Object(); - - private static final String caption = "This is a caption which is very long and nice and perhaps sometimes should be clipped"; - LegacyWindow main = new LegacyWindow("#2181 test"); - TextField tf1 = new TextField(caption, "Test field - undefined width"); - TextField tf2 = new TextField(caption, "Test field - 150px wide"); - Button setButton = new Button("Set", this); - private Random random = new Random(123); - private OptionGroup options; - - private static ArrayList<String> icons = new ArrayList<String>(); - static { - icons.add("icons/64/ok.png"); - icons.add("icons/64/arrow-down.png"); - icons.add("icons/64/arrow-left.png"); - icons.add("icons/64/arrow-right.png"); - icons.add("icons/64/arrow-up.png"); - } - - @Override - public void init() { - setMainWindow(main); - VerticalLayout ol; - ol = new VerticalLayout(); - ol.addComponent(tf1); - main.addComponent(ol); - - ol = new VerticalLayout(); - ol.setWidth("150px"); - tf2.setWidth("150px"); - ol.addComponent(tf2); - main.addComponent(ol); - - main.addComponent(createSelection()); - main.addComponent(setButton); - } - - private Component createSelection() { - options = new OptionGroup(); - options.addItem("Icon"); - options.addItem("Caption"); - options.addItem("Required"); - options.addItem("Error"); - options.setMultiSelect(true); - options.select("Caption"); - - // ol.addComponent(og); - return options; - } - - @Override - public void buttonClick(ClickEvent event) { - if (event.getButton() == setButton) { - set(); - } - } - - private void set() { - @SuppressWarnings("unchecked") - Set<String> values = (Set<String>) options.getValue(); - TextField[] tfs = new TextField[] { tf1, tf2 }; - for (TextField tf : tfs) { - // Clear all - tf.setCaption(null); - tf.setComponentError(null); - tf.setRequired(false); - tf.setIcon(null); - - for (String value : values) { - if (value.equals("Caption")) { - tf.setCaption(caption); - } else if (value.equals("Icon")) { - String timestamp = String.valueOf(new Date().getTime()); - tf.setIcon(new ThemeResource(icons.get(random.nextInt(icons - .size())) + "?" + timestamp)); - } else if (value.equals("Required")) { - tf.setRequired(true); - } else if (value.equals("Error")) { - tf.setComponentError(new UserError("Nooooo...")); - } - } - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2186.java b/uitest/src/com/vaadin/tests/tickets/Ticket2186.java deleted file mode 100644 index 8a467d385e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2186.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2186 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow main = new LegacyWindow("Quick test"); - setMainWindow(main); - - HorizontalLayout base = new HorizontalLayout(); - main.setContent(base); - - VerticalLayout content = new VerticalLayout(); - - content.addComponent(new Label("Content.")); - content.setWidth("500px"); - - Table table = new Table(); - - table.setPageLength(10); - - table.setWidth("100%"); - - table.addContainerProperty("Lähettäjä", String.class, ""); - table.addContainerProperty("Viestin tyyppi", String.class, ""); - - for (int i = 0; i < 15; i++) { - - table.addItem(new Object[] { i + " Joku Ihminen", "Testiviesti" }, - - new Object()); - - } - - content.addComponent(table); - - Panel right = new Panel("Panel"); - - right.setContent(new Label("Some basic text might show up here.")); - - base.addComponent(content); - - base.addComponent(right); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2204.java b/uitest/src/com/vaadin/tests/tickets/Ticket2204.java deleted file mode 100644 index e32b66ffc0..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2204.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.vaadin.data.Item; -import com.vaadin.data.util.BeanItem; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.AbstractSplitPanel; -import com.vaadin.ui.Accordion; -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.ComponentContainer; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.FormFieldFactory; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.VerticalSplitPanel; - -public class Ticket2204 extends LegacyApplication { - - private final List<RichTextArea> textAreas = new ArrayList<RichTextArea>(); - private TabSheet ts; - private final Map<Component, Component> containerToComponent = new HashMap<Component, Component>(); - private RichTextArea rta; - private final List<Class<? extends Component>> classes = new ArrayList<Class<? extends Component>>(); - protected RichTextArea formTextArea; - - @Override - public void init() { - classes.add(VerticalLayout.class); - classes.add(HorizontalLayout.class); - classes.add(GridLayout.class); - classes.add(Accordion.class); - classes.add(TabSheet.class); - classes.add(Panel.class); - classes.add(VerticalSplitPanel.class); - classes.add(HorizontalSplitPanel.class); - classes.add(Form.class); - - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - ts = new TabSheet(); - layout.addComponent(ts); - - for (Class<? extends Component> c : classes) { - ts.addTab(createComponent(c), c.getSimpleName(), null); - } - rta = new RichTextArea(); - rta.setVisible(false); - ts.addTab(rta, "Hidden rta", null); - - Button b = new Button("Show area", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - showHide(); - } - }); - - layout.addComponent(b); - - b = new Button("Show tab", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - showTab(); - } - }); - - layout.addComponent(b); - - } - - protected void showTab() { - rta.setVisible(!rta.isVisible()); - - } - - protected void showHide() { - Component c = containerToComponent.get(ts.getSelectedTab()); - c.setVisible(!c.isVisible()); - } - - private Component createComponent(Class<? extends Component> c) { - RichTextArea textArea = new RichTextArea(); - textArea.setVisible(false); - textArea.setCaption("This is the textArea"); - textArea.setWidth("200px"); - textArea.setHeight("100px"); - textAreas.add(textArea); - Component cc = null; - - try { - cc = c.newInstance(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - // if (c == OrderedLayout.class) { - // cc = new VerticalLayout(); - // } else - if (c == Accordion.class) { - // Label l = new Label("Filler"); - // l.setCaption("Filler label"); - // cc.addComponent(l); - } - - if (c == Form.class) { - Form f = (Form) cc; - f.setFormFieldFactory(new FormFieldFactory() { - - @Override - public Field<?> createField(Item item, Object propertyId, - Component uiContext) { - formTextArea = new RichTextArea(); - formTextArea.setVisible(false); - return formTextArea; - } - - }); - f.setItemDataSource(new BeanItem<Object>(new Object() { - private int a; - - @SuppressWarnings("unused") - public int getA() { - return a; - } - - @SuppressWarnings("unused") - public void setA(int a) { - this.a = a; - } - })); - containerToComponent.put(f, formTextArea); - return f; - } - containerToComponent.put(cc, textArea); - if (cc instanceof ComponentContainer) { - ((ComponentContainer) cc).addComponent(textArea); - } - - if (AbstractSplitPanel.class.isAssignableFrom(c)) { - AbstractSplitPanel sp = (AbstractSplitPanel) cc; - sp.setWidth("300px"); - sp.setHeight("300px"); - sp.addComponent(new Label("Label")); - textArea.setSizeFull(); - } - if (c == Panel.class) { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - ((Panel) cc).setContent(layout); - containerToComponent.put(cc, layout); - layout.setVisible(false); - textArea.setVisible(true); - return cc; - } - - return cc; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2208.java b/uitest/src/com/vaadin/tests/tickets/Ticket2208.java deleted file mode 100644 index 5589f242f1..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2208.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.Table.CellStyleGenerator; -import com.vaadin.ui.Table.ColumnGenerator; - -public class Ticket2208 extends LegacyApplication { - - private Table t; - - @Override - public void init() { - LegacyWindow mainWindow = new LegacyWindow(); - setMainWindow(mainWindow); - - t = new Table("A table"); - t.addContainerProperty("col 1 (red)", String.class, ""); - t.addContainerProperty("col 2", String.class, ""); - - t.setHeight("150px"); - t.addGeneratedColumn("col 3 (green)", new ColumnGenerator() { - - @Override - public Component generateCell(Table source, Object itemId, - Object columnId) { - Item item = source.getItem(itemId); - String col1 = (String) item.getItemProperty("col 1 (red)") - .getValue(); - String col2 = (String) item.getItemProperty("col 2").getValue(); - return new Label(col1 + "-" + col2); - } - }); - - t.addContainerProperty("col 4", String.class, ""); - t.setCellStyleGenerator(new CellStyleGenerator() { - - @Override - public String getStyle(Table source, Object itemId, - Object propertyId) { - if ("col 1 (red)".equals(propertyId)) { - return "red"; - } - - if ("col 3 (green)".equals(propertyId)) { - return "green"; - } - - return null; - } - }); - - t.addItem(new Object[] { "Col 1-1", "Col 2-1", "Col 4-1" }, - new Object()); - t.addItem(new Object[] { "Col 1-2", "Col 2-2", "Col 4-2" }, - new Object()); - t.addItem(new Object[] { "Col 1-3", "Col 2-3", "Col 4-3" }, - new Object()); - - t.setColumnReorderingAllowed(true); - t.setColumnCollapsingAllowed(true); - setTheme("tests-tickets"); - mainWindow.addComponent(t); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2209.java b/uitest/src/com/vaadin/tests/tickets/Ticket2209.java deleted file mode 100644 index 95666f9315..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2209.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2209 extends LegacyApplication { - - private GridLayout gl; - private ComboBox combo; - private Label labelLong; - - @Override - public void init() { - setMainWindow(new LegacyWindow()); - - gl = new GridLayout(1, 2); - gl.setStyleName("borders"); - getMainWindow().addComponent(gl); - setTheme("tests-tickets"); - combo = new ComboBox("Combo caption"); - labelLong = new Label( - "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"); - gl.addComponent(combo); - gl.addComponent(labelLong); - - Button b = new Button("Add label text", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - labelLong.setValue(labelLong.getValue() + "-12345"); - } - - }); - getMainWindow().addComponent(b); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2209OL.java b/uitest/src/com/vaadin/tests/tickets/Ticket2209OL.java deleted file mode 100644 index b4832dc2d4..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2209OL.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2209OL extends LegacyApplication { - - private VerticalLayout gl; - private ComboBox combo; - private Label labelLong; - - @Override - public void init() { - setMainWindow(new LegacyWindow()); - getMainWindow().getContent().setWidth("250px"); - gl = new VerticalLayout(); - gl.setStyleName("borders"); - getMainWindow().addComponent(gl); - setTheme("tests-tickets"); - combo = new ComboBox("Combo caption"); - labelLong = new Label( - "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. " - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"); - gl.addComponent(combo); - gl.addComponent(labelLong); - - Button b = new Button("Add label text", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - labelLong.setValue(labelLong.getValue() + "-12345"); - } - - }); - getMainWindow().addComponent(b); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2209OL2.java b/uitest/src/com/vaadin/tests/tickets/Ticket2209OL2.java deleted file mode 100644 index 58abbf51f5..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2209OL2.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2209OL2 extends LegacyApplication { - - private VerticalLayout gl; - private ComboBox combo; - private Label labelLong; - - @Override - public void init() { - setMainWindow(new LegacyWindow()); - getMainWindow().getContent().setWidth("250px"); - gl = new VerticalLayout(); - gl.setSizeUndefined(); - gl.setStyleName("borders"); - getMainWindow().addComponent(gl); - setTheme("tests-tickets"); - combo = new ComboBox("Combo caption"); - labelLong = new Label( - "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. " - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"); - gl.addComponent(combo); - gl.addComponent(labelLong); - - Button b = new Button("Add label text", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - labelLong.setValue(labelLong.getValue() + "-12345"); - } - - }); - getMainWindow().addComponent(b); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2215.java b/uitest/src/com/vaadin/tests/tickets/Ticket2215.java deleted file mode 100644 index 42db5d0efb..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2215.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.themes.Reindeer; - -public class Ticket2215 extends LegacyApplication { - - @Override - public void init() { - setMainWindow(new LegacyWindow()); - - VerticalLayout ol = new VerticalLayout(); - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel("Test", pl); - pl.addComponent(new Label("Panel1")); - p.setHeight("500px"); - p.setWidth("500px"); - p.setStyleName(Reindeer.PANEL_LIGHT); - ol.addComponent(p); - ol.addComponent(new Label("NextComponent")); - - getMainWindow().addComponent(ol); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2221.java b/uitest/src/com/vaadin/tests/tickets/Ticket2221.java deleted file mode 100644 index 80aaf55845..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2221.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -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.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2221 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - layout.setSizeFull(); - layout.addComponent(new Invoice()); - } - - public class Invoice extends CustomComponent { - - Layout main = new VerticalLayout(); - - private TextField tf; - - private Panel outerPanel; - - private TextField tf2; - - public Invoice() { - setSizeFull(); - - setCompositionRoot(main); - main.setSizeFull(); - Button b = new Button("Switch textfield/panel", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Component visible = tf; - - if (tf.isVisible()) { - visible = outerPanel; - } - - outerPanel.setVisible(false); - tf.setVisible(false); - - visible.setVisible(true); - } - - }); - main.addComponent(b); - - tf = new TextField("TextField"); - tf.setHeight("1000px"); - tf.setWidth("1000px"); - - VerticalLayout outerLayout = new VerticalLayout(); - outerLayout.setMargin(true); - outerPanel = new Panel(outerLayout); - outerPanel.setCaption("A RichTextArea"); - outerPanel.setVisible(false); - outerPanel.setHeight("1000px"); - outerPanel.setWidth("1000px"); - - outerLayout.setSizeFull(); - VerticalLayout innerLayout = new VerticalLayout(); - innerLayout.setMargin(true); - Panel innerPanel = new Panel("Inner panel", innerLayout); - innerPanel.setSizeFull(); - outerLayout.addComponent(innerPanel); - - tf2 = new TextField("A 2000x2000 textfield"); - tf2.setWidth("2000px"); - tf2.setHeight("2000px"); - - innerLayout.addComponent(tf2); - main.addComponent(outerPanel); - main.addComponent(tf); - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2222.java b/uitest/src/com/vaadin/tests/tickets/Ticket2222.java deleted file mode 100644 index e86072d055..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2222.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2222 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - HorizontalLayout horiz = new HorizontalLayout(); - horiz.setSpacing(true); - horiz.setMargin(true); - horiz.setStyleName("ticket2222"); - - horiz.addComponent(new Label("Horiz spacing: 60px;")); - horiz.addComponent(new Label("Margin-left: 40px")); - horiz.addComponent(new Label("Margin-top: 100px;")); - horiz.addComponent(new Label("Margin-right: 20px;")); - horiz.addComponent(new Label("Margin-bottom: 30px;")); - horiz.addStyleName("borders"); - - VerticalLayout vert = new VerticalLayout(); - vert.setSizeUndefined(); - vert.setSpacing(true); - vert.setMargin(false); - vert.setStyleName("ticket2222"); - vert.addComponent(new Label("Vert spacing: 50px;")); - vert.addComponent(new Label("No margins")); - vert.addComponent(new Label("label 3")); - vert.addStyleName("borders"); - - GridLayout gl = new GridLayout(3, 2); - gl.setStyleName("borders"); - gl.setSpacing(true); - gl.setMargin(true); - gl.setStyleName("ticket2222"); - gl.addComponent(new Label("Vert spacing: 50px; horiz 20px;")); - gl.addComponent(new Label("Margin-left: 40px")); - gl.addComponent(new Label("Margin-top: 100px;")); - gl.addComponent(new Label("Margin-right: 20px;")); - gl.addComponent(new Label("Margin-bottom: 30px;")); - gl.addComponent(new Label("label 3")); - gl.addStyleName("borders"); - - layout.addComponent(horiz); - layout.addComponent(new Label(" ")); - layout.addComponent(vert); - layout.addComponent(new Label(" ")); - layout.addComponent(gl); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/uitest/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java deleted file mode 100644 index eb7a08eafa..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2227OrderedlayoutInTable extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(); - Table t = new Table(); - t.setWidth("500px"); - t.setHeight("200px"); - t.addContainerProperty("pno", String.class, ""); - t.addContainerProperty("testi", String.class, ""); - 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" }); - - t.setSelectable(true); - - Item i = t.addItem(1); - i.getItemProperty("pno").setValue("1"); - i.getItemProperty("testi").setValue("12.12.08"); - VerticalLayout ol = new VerticalLayout(); - ol.setWidth("100%"); - ol.setHeight(null); - ol.addComponent(new Label("monirivi testi")); - ol.addComponent(new Label("monirivi testi2")); - - i.getItemProperty("testi2").setValue(ol); - i.getItemProperty("nimi").setValue("test"); - - w.addComponent(t); - setMainWindow(w); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2231.java b/uitest/src/com/vaadin/tests/tickets/Ticket2231.java deleted file mode 100644 index 5bc49e5c29..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2231.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2231 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - layout.setSizeUndefined(); - layout.setMargin(false); - layout.setStyleName("borders"); - Label l = new Label("Margin-label"); - - l.setStyleName("ticket2231"); - - layout.addComponent(l); - - for (int i = 0; i < 5; i++) { - l = new Label("This is a label with border"); - l.setStyleName("ticket2231-border"); - if (i == 2) { - l.setWidth("100%"); - l.setValue("100% wide"); - } else if (i == 4) { - l.setWidth("20em"); - l.setValue("20em wide"); - } - // l.addStyleName("ticket2231"); - layout.addComponent(l); - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2232.java b/uitest/src/com/vaadin/tests/tickets/Ticket2232.java deleted file mode 100644 index 16fec93c44..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2232.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Layout.SpacingHandler; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2232 extends LegacyApplication { - - @Override - public void init() { - setMainWindow(new LegacyWindow()); - setTheme("tests-tickets"); - - getMainWindow() - .addComponent( - new Label( - "Defining spacing must be possible also with pure CSS")); - - Layout gl; - gl = new VerticalLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - gl.setStyleName("t2232"); - fillAndAdd(gl); - - gl = new GridLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - gl.setStyleName("t2232"); - fillAndAdd(gl); - - gl = new VerticalLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - ((SpacingHandler) gl).setSpacing(true); - fillAndAdd(gl); - - gl = new GridLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - ((SpacingHandler) gl).setSpacing(true); - fillAndAdd(gl); - - gl = new VerticalLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - fillAndAdd(gl); - - gl = new GridLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - fillAndAdd(gl); - - } - - private void fillAndAdd(Layout gl) { - for (int i = 0; i < 4; i++) { - Button b = new Button("B"); - b.setSizeFull(); - gl.addComponent(b); - } - String caption = gl.getClass().getSimpleName(); - caption += " style: " + gl.getStyleName() + ", spacingFromServer:" - + ((SpacingHandler) gl).isSpacing(); - gl.setCaption(caption); - getMainWindow().addComponent(gl); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2234.java b/uitest/src/com/vaadin/tests/tickets/Ticket2234.java deleted file mode 100644 index c7ccf118fa..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2234.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2234 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - ComboBox combo = new ComboBox("Combobox caption"); - combo.addContainerProperty("blah", String.class, ""); - combo.setItemCaptionPropertyId("blah"); - - Item item; - for (int i = 0; i < 100; i++) { - item = combo.addItem(new Object()); - item.getItemProperty("blah").setValue("Item " + i); - } - - layout.addComponent(combo); - - combo = new ComboBox("Combobox caption"); - combo.addContainerProperty("blah", String.class, ""); - combo.setItemCaptionPropertyId("blah"); - - for (int i = 0; i < 5; i++) { - item = combo.addItem(new Object()); - item.getItemProperty("blah").setValue("Item " + i); - } - - layout.addComponent(combo); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2235.java b/uitest/src/com/vaadin/tests/tickets/Ticket2235.java deleted file mode 100644 index ced57a26ce..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2235.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextArea; - -public class Ticket2235 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - layout.setSizeFull(); - - TextArea tf = new TextArea(); - tf.setCaption("A text field"); - tf.setSizeFull(); - tf.setRows(2); - - layout.addComponent(tf); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2240.java b/uitest/src/com/vaadin/tests/tickets/Ticket2240.java deleted file mode 100644 index 1bec778b75..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2240.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket2240 extends LegacyApplication { - - public static final String txt = "<p>There are two main types of windows: application-level windows, and " - + "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window" - + " within the (native) browser window to which it was added. You can create" - + " a sub window by creating a new Window and adding it to a application-level window, for instance" - + " your main window. </p><p> In contrast, you create a application-level window by" - + " creating a new Window and adding it to the Application. Application-level" - + " windows are not shown by default - you need to open a browser window for" - + " the url representing the window. You can think of the application-level" - + " windows as separate views into your application - and a way to create a" - + " \"native\" browser window.</p><p>Depending on your needs, it's also" - + " possible to create a new window instance (with it's own internal state)" - + " for each new (native) browser window, or you can share the same instance" - + " (and state) between several browser windows (the latter is most useful" - + " for read-only views).</p><br/><p>This is the end.</p>"; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - layout.setHeight(null); - layout.setStyleName("borders"); - // layout.setSizeFull(); - final Label l = new Label(txt); - l.setContentMode(ContentMode.HTML); - // l.setWidth("100%"); - - TextField tf = new TextField("This is a textField"); - tf.setWidth("100%"); - - layout.addComponent(tf); - layout.addComponent(l); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2242.java b/uitest/src/com/vaadin/tests/tickets/Ticket2242.java deleted file mode 100644 index d100f61e30..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2242.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -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.server.LegacyApplication; -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.LegacyWindow; -import com.vaadin.ui.Table; - -public class Ticket2242 extends LegacyApplication implements - ValueChangeListener { - - private Object tableValue = null; - private Table t; - private String valueDataSource = "-"; - private ObjectProperty<String> prop; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - Button b = new Button("Change container datasource", - new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - for (int i = 0; i < 5; i++) { - t.setContainerDataSource(createContainer()); - // prop.setValue("ipsum"); - } - } - - }); - - layout.addComponent(b); - - t = new Table("A table"); - prop = new ObjectProperty<String>(valueDataSource); - t.setPropertyDataSource(prop); - t.setSelectable(true); - t.setImmediate(true); - t.setPageLength(5); - t.setContainerDataSource(createContainer()); - tableValue = t.getValue(); - t.addListener(this); - - layout.addComponent(t); - } - - private IndexedContainer createContainer() { - IndexedContainer ic = new IndexedContainer(); - ic.addContainerProperty("a", String.class, null); - - for (String s : new String[] { "Lorem", "ipsum", "dolor", "sit", - "amet", "consectetuer" }) { - Item item = ic.addItem(s); - item.getItemProperty("a").setValue(s); - - } - - return ic; - } - - @Override - public void valueChange(ValueChangeEvent event) { - System.out.println("Value change from " + tableValue + " to " - + t.getValue()); - tableValue = t.getValue(); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2244.java b/uitest/src/com/vaadin/tests/tickets/Ticket2244.java deleted file mode 100644 index fcb1c55f33..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2244.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.BeanItem; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Form; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2244 extends LegacyApplication { - - Form form; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - GridLayout gl = new GridLayout(3, 3); - gl.setSpacing(true); - gl.addComponent(new Label("Before form")); - gl.newLine(); - - form = new Form(gl); - form.setItemDataSource(new BeanItem<MyBean>(new MyBean())); - - gl.addComponent(new Label("After form")); - - w.addComponent(form); - - w.addComponent(new Button("new item", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - form.setItemDataSource(new BeanItem<MyBean>(new MyBean())); - - } - - })); - w.addComponent(new Button("new bigger item", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - form.setItemDataSource(new BeanItem<MyBean>( - new MyBiggerBean())); - - } - - })); - w.addComponent(new Button("new grid layout", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - form.setLayout(new GridLayout()); - - } - - })); - w.addComponent(new Button("new form layout", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - form.setLayout(new FormLayout()); - - } - - })); - - } - - public class MyBean { - String firstname; - String lastname; - String password; - - public String getFirstname() { - return firstname; - } - - public void setFirstname(String firstname) { - this.firstname = firstname; - } - - public String getLastname() { - return lastname; - } - - public void setLastname(String lastname) { - this.lastname = lastname; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - } - - public class MyBiggerBean extends MyBean { - String address; - String phone; - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2245.java b/uitest/src/com/vaadin/tests/tickets/Ticket2245.java deleted file mode 100644 index 493ec8f9f3..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2245.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2245 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow main = new LegacyWindow("The Main Window"); - main.getContent().setSizeFull(); - setMainWindow(main); - HorizontalSplitPanel sp = new HorizontalSplitPanel(); - main.addComponent(sp); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2267.java b/uitest/src/com/vaadin/tests/tickets/Ticket2267.java deleted file mode 100644 index 74f2d77d67..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2267.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2267 extends LegacyApplication { - - Label l = new Label("0"); - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout gl = new GridLayout(4, 2); - - Button button = new Button("1", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - Button b = event.getButton(); - l.setValue(l.getValue() + b.getCaption()); - - } - - }); - - gl.addComponent(l, 0, 0, 3, 0); - gl.addComponent(button); - gl.addComponent(new Label("2")); - gl.addComponent(new Label("3")); - gl.addComponent(new Label("4")); - - w.setContent(gl); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2271.java b/uitest/src/com/vaadin/tests/tickets/Ticket2271.java deleted file mode 100644 index f10f0df76e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2271.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2271 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - - VerticalLayout ol = new VerticalLayout(); - ol.setWidth(null); - - ComboBox cb = new ComboBox("Asiakas"); - cb.setWidth("100%"); - - Button b = new Button("View CSV-tiedostoon"); - - ol.addComponent(cb); - ol.addComponent(b); - - layout.addComponent(ol); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2282.java b/uitest/src/com/vaadin/tests/tickets/Ticket2282.java deleted file mode 100644 index b5d4990e21..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2282.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2282 extends LegacyApplication { - - private FormLayout layout1; - private FormLayout layout2; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - w.getContent().setSizeUndefined(); - - layout1 = new FormLayout(); - layout1.setSizeUndefined(); - layout1.setStyleName("borders"); - Label label = new Label( - "This should not be wider than this label + reserved error space"); - label.setCaption("A caption"); - layout1.addComponent(label); - w.addComponent(layout1); - - layout2 = new FormLayout(); - layout2.setWidth("500px"); - layout2.setStyleName("borders"); - label = new Label("This should be 500px wide"); - label.setCaption("A caption"); - layout2.addComponent(label); - w.addComponent(layout2); - - Button b = new Button("Swap", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - if (layout1.getWidth() < 0.0) { - layout1.setWidth("500px"); - layout2.setWidth(null); - } else { - layout1.setWidth(null); - layout2.setWidth("500px"); - } - } - - }); - w.addComponent(b); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2283.java b/uitest/src/com/vaadin/tests/tickets/Ticket2283.java deleted file mode 100644 index ffe419293d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2283.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2283 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - GridLayout gl = new GridLayout(2, 2); - gl.setSizeUndefined(); - - gl.addComponent(new Label( - "Label 1 abc abc abcasdfas dfasd fasdf asdf sadf asdf")); - gl.addComponent(new Label("Label 2 abc abc abc ")); - Label l = new Label("Colspan2, align right"); - gl.addComponent(l, 0, 1, 1, 1); - gl.setComponentAlignment(l, Alignment.TOP_RIGHT); - w.setContent(gl); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2287.java b/uitest/src/com/vaadin/tests/tickets/Ticket2287.java deleted file mode 100644 index 717ced35cb..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2287.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.net.URL; - -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2287 extends Ticket2292 { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - URL url = getURL(); - main.addComponent(new Label( - "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout).")); - - Label l = new Label(); - l.setContentMode(ContentMode.HTML); - l.setValue("This is a label with as slow image. <img src=\"" + url - + "/icon.png\" />"); - main.addComponent(l); - - l = new Label(); - l.setContentMode(ContentMode.HTML); - l.setValue("This is a label with as slow image. <img src=\"" + url - + "/icon.png\" />"); - main.addComponent(l); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2289.java b/uitest/src/com/vaadin/tests/tickets/Ticket2289.java deleted file mode 100644 index 259c9597b1..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2289.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Accordion; -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.LegacyWindow; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2289 extends LegacyApplication { - - TabSheet ts = null; - Accordion acc = null; - - @Override - public void init() { - - LegacyWindow w = new LegacyWindow(); - setMainWindow(w); - VerticalLayout ol = new VerticalLayout(); - w.setContent(ol); - Button b = new Button("close current tab"); - b.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - closeCurrentTab(); - - } - }); - ol.addComponent(b); - - b = new Button("close first tab"); - b.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - closeFirstTab(); - - } - }); - - ol.addComponent(b); - ts = new TabSheet(); - ts.setSizeUndefined(); - ts.setWidth("300px"); - ts.addTab(new MyTab("tab one"), "Caption1", null); - ts.addTab(new MyTab("tab two"), "Caption2", null); - ts.addTab(new MyTab("tab three"), "Caption3", null); - ts.addTab(new MyTab("tab four"), "Caption4", null); - ts.addTab(new MyTab("tab five"), "Caption5", null); - - acc = new Accordion(); - acc.setSizeUndefined(); - acc.addTab(new MyTab("tab one"), "Caption1", null); - acc.addTab(new MyTab("tab two"), "Caption2", null); - acc.addTab(new MyTab("tab three"), "Caption3", null); - acc.addTab(new MyTab("tab four"), "Caption4", null); - - ol.addComponent(acc); - ts = null; - // ol.addComponent(ts); - - } - - private void closeCurrentTab() { - if (ts != null) { - MyTab m = (MyTab) ts.getSelectedTab(); - if (m != null) { - ts.removeComponent(m); - } - } - if (acc != null) { - MyTab m = (MyTab) acc.getSelectedTab(); - if (m != null) { - acc.removeComponent(m); - } - } - } - - private void closeFirstTab() { - if (ts != null) { - ts.removeComponent(ts.getComponentIterator().next()); - } - if (acc != null) { - acc.removeComponent(acc.getComponentIterator().next()); - } - } - -} - -class MyTab extends CustomComponent { - public MyTab(String text) { - setSizeUndefined(); - HorizontalLayout ol = new HorizontalLayout(); - setCompositionRoot(ol); - ol.addComponent(new Label(text)); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java b/uitest/src/com/vaadin/tests/tickets/Ticket2292.java deleted file mode 100644 index b50a1d073e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2292.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.awt.Color; -import java.awt.Graphics; -import java.awt.image.BufferedImage; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; - -import javax.imageio.ImageIO; - -import com.vaadin.server.DownloadStream; -import com.vaadin.server.ExternalResource; -import com.vaadin.server.RequestHandler; -import com.vaadin.server.VaadinRequest; -import com.vaadin.server.VaadinResponse; -import com.vaadin.server.VaadinSession; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Link; - -public class Ticket2292 extends com.vaadin.server.LegacyApplication implements - RequestHandler { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - ExternalResource icon = new ExternalResource("./icon.png"); - main.addComponent(new Label( - "Note, run with trailing slash in url to have a working icon. Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)")); - Button b = new Button(); - main.addComponent(b); - b.setIcon(icon); - - CheckBox checkBox = new CheckBox(); - main.addComponent(checkBox); - checkBox.setIcon(icon); - - Link l = new Link("l", icon); - main.addComponent(l); - - VaadinSession.getCurrent().addRequestHandler(this); - } - - @Override - public boolean handleRequest(VaadinSession session, VaadinRequest request, - VaadinResponse response) throws IOException { - String relativeUri = request.getPathInfo(); - - if (!relativeUri.contains("icon.png")) { - return false; - } - - // be slow to show bug - try { - Thread.sleep(2000); - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - BufferedImage image = new BufferedImage(200, 200, - BufferedImage.TYPE_INT_RGB); - Graphics drawable = image.getGraphics(); - drawable.setColor(Color.lightGray); - drawable.fillRect(0, 0, 200, 200); - drawable.setColor(Color.yellow); - drawable.fillOval(25, 25, 150, 150); - drawable.setColor(Color.blue); - drawable.drawRect(0, 0, 199, 199); - - // Use the parameter to create dynamic content. - drawable.setColor(Color.black); - drawable.drawString("Tex", 75, 100); - - try { - // Write the image to a buffer. - ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream(); - ImageIO.write(image, "png", imagebuffer); - - // Return a stream from the buffer. - ByteArrayInputStream istream = new ByteArrayInputStream( - imagebuffer.toByteArray()); - new DownloadStream(istream, null, null).writeResponse(request, - response); - return true; - } catch (IOException e) { - return false; - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2294.java b/uitest/src/com/vaadin/tests/tickets/Ticket2294.java deleted file mode 100644 index ad8642ccf3..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2294.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2294 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((AbstractOrderedLayout) w.getContent()); - } - - private void createUI(AbstractOrderedLayout layout) { - Label label1 = new Label(); - Label label2 = null; - Label label3 = new Label(); - String result1 = ""; - String result2 = ""; - String result3 = ""; - - layout.addComponent(label1); - try { - layout.setComponentAlignment(label1, Alignment.BOTTOM_LEFT); - result1 = "OK"; - } catch (Exception e) { - result1 = "FAILED: " + e.getMessage(); - } - - try { - layout.setComponentAlignment(label2, Alignment.BOTTOM_LEFT); - result2 = "FAILED, no exception"; - } catch (IllegalArgumentException e) { - result2 = "OK"; - } catch (Exception e) { - result2 = "FAILED: " + e.getMessage(); - } - - try { - layout.setComponentAlignment(label3, Alignment.BOTTOM_LEFT); - result3 = "FAILED, no exception"; - } catch (IllegalArgumentException e) { - result3 = "OK"; - } catch (Exception e) { - result3 = "FAILED: " + e.getMessage(); - } - - label1.setValue("Result 1: " + result1 + ", result 2: " + result2 - + ", result 3: " + result3); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2296.java b/uitest/src/com/vaadin/tests/tickets/Ticket2296.java deleted file mode 100644 index 13fd7cf557..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2296.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2296 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - CustomLayout cl = new CustomLayout("Ticket2296"); - cl.setSizeFull(); - Button b = new Button("100%x100% button"); - b.setSizeFull(); - cl.addComponent(b, "button1"); - - b = new Button("100%x100% button"); - b.setSizeFull(); - cl.addComponent(b, "button2"); - - b = new Button("50%x50% button"); - b.setWidth("50%"); - b.setHeight("50%"); - cl.addComponent(b, "button3"); - - w.setContent(cl); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2297.java b/uitest/src/com/vaadin/tests/tickets/Ticket2297.java deleted file mode 100644 index b4a3d02efa..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2297.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.URL; - -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2297 extends Ticket2292 { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - URL url = getURL(); - main.addComponent(new Label( - "Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout).")); - - try { - CustomLayout cl = new CustomLayout( - new ByteArrayInputStream( - ("This is an empty CustomLayout with as slow image. <img src=\"" - + url.toString() + "/icon.png\" />") - .getBytes())); - main.addComponent(cl); - - cl = new CustomLayout( - new ByteArrayInputStream( - ("This is an empty CustomLayout with as slow image. <img src=\"" - + url.toString() + "/icon.png\" />") - .getBytes())); - main.addComponent(cl); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2303.java b/uitest/src/com/vaadin/tests/tickets/Ticket2303.java deleted file mode 100644 index be85f2d481..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2303.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.IOException; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2303 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow("main window"); - - String customlayout = "<div location=\"test\"></div>"; - CustomLayout cl = null; - try { - cl = new CustomLayout(new ByteArrayInputStream( - customlayout.getBytes())); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - cl.setWidth("100%"); - w.setContent(cl); - - // VerticalLayout ol = new VerticalLayout(); - // w.setContent(ol); - VerticalLayout hugeLayout = new VerticalLayout(); - hugeLayout.setMargin(true); - hugeLayout.setSpacing(true); - for (int i = 0; i < 30; i++) { - hugeLayout.addComponent(new Label("huge " + i)); - } - cl.addComponent(hugeLayout, "test"); - // ol.addComponent(hugeLayout); - setMainWindow(w); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2304.java b/uitest/src/com/vaadin/tests/tickets/Ticket2304.java deleted file mode 100644 index 83e36eaf13..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2304.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.themes.Reindeer; - -public class Ticket2304 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel(pl); - p.setStyleName(Reindeer.PANEL_LIGHT); - main.addComponent(p); - p.setHeight("100px"); - - Label l = new Label( - "a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n"); - l.setContentMode(ContentMode.PREFORMATTED); - pl.addComponent(l); - main.addComponent(new Label( - "This text should be right below the panel, w/o spacing")); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2310.java b/uitest/src/com/vaadin/tests/tickets/Ticket2310.java deleted file mode 100644 index fb0d399d94..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2310.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.themes.Reindeer; - -public class Ticket2310 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(getClass().getName() - .substring(getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.addComponent(new Label("Instructions: change label when panel is " - + "invisible -> invalid change (with disabled " - + "flag) is sent to client. Label is grey when panel is shown.")); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - final Panel p = new Panel(pl); - p.setStyleName(Reindeer.PANEL_LIGHT); - main.addComponent(p); - p.setHeight("100px"); - - final Label l = new Label("foobar"); - - pl.addComponent(l); - - Button b = new Button("change label"); - - b.addListener(new Button.ClickListener() { - int i = 0; - - @Override - public void buttonClick(ClickEvent event) { - - l.setValue("foobar " + i++); - - } - }); - - Button b2 = new Button("toggle panel visibility"); - b2.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - p.setVisible(!p.isVisible()); - } - }); - - main.addComponent(b); - main.addComponent(b2); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2319.java b/uitest/src/com/vaadin/tests/tickets/Ticket2319.java deleted file mode 100644 index fbe1796b32..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2319.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.VerticalSplitPanel; - -public class Ticket2319 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow mainw = new LegacyWindow(); - setMainWindow(mainw); - - mainw.addComponent(new Label( - "This test has somewhat invalid layouts in it to detect analyzy layout function in debug dialog")); - - HorizontalLayout hl = new HorizontalLayout(); - Panel panel = buildPanel("p1"); - Panel panel2 = buildPanel("p2"); - hl.addComponent(panel); - hl.addComponent(panel2); - - mainw.addComponent(hl); - - hl = new HorizontalLayout(); - panel = buildPanel("p1"); - panel.setSizeUndefined(); - panel.setHeight("100%"); - panel2 = buildPanel("p2"); - panel2.setSizeUndefined(); - panel2.setHeight("100%"); - - hl.addComponent(panel); - hl.addComponent(panel2); - mainw.addComponent(hl); - - HorizontalSplitPanel sp = new HorizontalSplitPanel(); - - VerticalLayout first = new VerticalLayout(); - first.addComponent(new Label("first")); - VerticalLayout second = new VerticalLayout(); - second.addComponent(new Label("second")); - - sp.setFirstComponent(first); - sp.setSecondComponent(second); - - VerticalSplitPanel sp2 = new VerticalSplitPanel(); - Label label = new Label("first"); - label.setSizeFull(); - sp2.setFirstComponent(label); - sp2.setSecondComponent(sp); - - sp2.setHeight("200px"); - - mainw.addComponent(sp2); - - mainw.addComponent(new Button("click me to save split panel state")); - } - - private Panel buildPanel(String caption) { - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - return new Panel(caption, pl); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2323.java b/uitest/src/com/vaadin/tests/tickets/Ticket2323.java deleted file mode 100644 index d9bbde52aa..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2323.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2323 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - Window subWindow = new Window("", layout); - subWindow.setSizeUndefined(); - subWindow.getContent().setSizeUndefined(); - subWindow.center(); - subWindow.setContent(new RichTextArea()); - w.addWindow(subWindow); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2325.java b/uitest/src/com/vaadin/tests/tickets/Ticket2325.java deleted file mode 100644 index d18bef8919..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2325.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2325 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow main = new LegacyWindow("Testing...."); - setMainWindow(main); - - final VerticalLayout lo = new VerticalLayout(); - lo.setSizeUndefined(); - lo.setWidth("100%"); - TextArea tf = new TextArea(); - tf.setValue("The textfield should fill the window." - + "\n - Try to resize window\n - Try to push REdo button"); - tf.setRows(10); - tf.setWidth("100%"); - lo.addComponent(tf); - Window subWin = new Window( - "This window should initially be as wide as the caption", lo); - main.addWindow(subWin); - // subWin.setWidth("500px"); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2329.java b/uitest/src/com/vaadin/tests/tickets/Ticket2329.java deleted file mode 100644 index 29101986e6..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2329.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.Table.ColumnGenerator; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2329 extends LegacyApplication { - private Table table; - private VerticalLayout mainLo; - - @Override - public void init() { - LegacyWindow mainw = new LegacyWindow(); - setMainWindow(mainw); - mainLo = (VerticalLayout) mainw.getContent(); - table = new Table(); - for (int i = 0; i < 10000; i++) { - table.addItem(i); - } - TestColumnGenerator cgen = new TestColumnGenerator(); - table.addGeneratedColumn("col1", cgen); - table.addGeneratedColumn("col2", cgen); - table.addGeneratedColumn("col3", cgen); - table.addGeneratedColumn("col4", cgen); - table.addGeneratedColumn("col5", cgen); - table.addGeneratedColumn("col6", cgen); - table.addGeneratedColumn("col7", cgen); - table.setHeight("500px"); - mainLo.addComponent(table); - } - - class TestColumnGenerator implements ColumnGenerator { - @Override - public Component generateCell(Table source, Object rowId, - Object columnId) { - return new Button("1"); - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2337.java b/uitest/src/com/vaadin/tests/tickets/Ticket2337.java deleted file mode 100644 index 80654ff678..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2337.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2337 extends LegacyApplication { - - GridLayout gl = new GridLayout(3, 1); - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(); - setMainWindow(w); - Button b = new Button("add", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - gl.addComponent(new Label("asd"), 0, gl.getCursorY(), 2, - gl.getCursorY()); - - } - - }); - w.addComponent(b); - - b = new Button("empty", new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - gl.removeAllComponents(); - - } - - }); - w.addComponent(b); - - w.addComponent(gl); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2339.java b/uitest/src/com/vaadin/tests/tickets/Ticket2339.java deleted file mode 100644 index 8683711bdc..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2339.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.IOException; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2339 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow(getClass() - .getSimpleName()); - setMainWindow(mainWin); - - try { - CustomLayout cl = new CustomLayout( - new ByteArrayInputStream( - "<div style=\"width:400px;overflow:hidden;background-color:red;\"><div style=\"border:1em solid blue; height:4em; padding:1em 1.5em;\" location=\"b\"></div></div>" - .getBytes())); - Button button = new Button("b"); - button.setSizeFull(); - - cl.addComponent(button, "b"); - - mainWin.addComponent(cl); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2341.java b/uitest/src/com/vaadin/tests/tickets/Ticket2341.java deleted file mode 100644 index 594e603c43..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2341.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -public class Ticket2341 extends com.vaadin.server.LegacyApplication { - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - constructTables((Layout) main.getContent()); - } - - private void constructTables(Layout layout) { - - Table t = createTable(); - layout.addComponent(t); - t = createTable(); - Label l = new Label("A high label to enable scrollbars"); - l.setHeight("2000px"); - layout.addComponent(l); - - } - - private Table createTable() { - Table t = new Table(); - t.addContainerProperty("test1", String.class, ""); - t.addContainerProperty("test2", String.class, ""); - t.addContainerProperty("test3", String.class, ""); - t.addContainerProperty("test4", String.class, ""); - t.setWidth("100%"); - t.setHeight("300px"); - for (int i = 0; i < 100; i++) { - Item item = t.addItem(i); - item.getItemProperty("test1").setValue("testing1 " + i); - item.getItemProperty("test2").setValue("testing2 " + i); - item.getItemProperty("test3").setValue("testing3 " + i); - item.getItemProperty("test4").setValue("testing4 " + i); - } - - return t; - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2344.java b/uitest/src/com/vaadin/tests/tickets/Ticket2344.java deleted file mode 100644 index a24351c3aa..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2344.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Random; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.themes.BaseTheme; - -public class Ticket2344 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow main = new LegacyWindow("Quick test"); - - setMainWindow(main); - - // setTheme("quicktest"); - - VerticalLayout hl = new VerticalLayout(); - hl.setWidth("400px"); - main.setContent(hl); - - Table t = new Table(); - t.setWidth("100%"); - - t.addContainerProperty("Prop 1", VerticalLayout.class, ""); - t.addContainerProperty("Prop 2", String.class, ""); - t.addContainerProperty("Prop 3", String.class, ""); - t.addContainerProperty("Prop 4", String.class, ""); - t.addContainerProperty("Prop 5", Button.class, ""); - - t.setPageLength(3); - - for (int i = 0; i < 10; i++) { - - VerticalLayout vl = new VerticalLayout(); - // vl.setWidth(null); - Button b = new Button("String 1 2 3"); - b.setStyleName(BaseTheme.BUTTON_LINK); - vl.addComponent(b); - t.addItem(new Object[] { vl, "String 2", "String 3", "String 4", - - new Button("String 5") }, new Integer(new Random().nextInt())); - - } - - hl.addComponent(t); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2347.java b/uitest/src/com/vaadin/tests/tickets/Ticket2347.java deleted file mode 100644 index 8cf70894b1..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2347.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2347 extends LegacyApplication { - - private Button b1; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((VerticalLayout) w.getContent()); - } - - private void createUI(VerticalLayout layout) { - CustomLayout cl = new CustomLayout("Ticket2347"); - b1 = new Button("200px button"); - b1.addListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - if (b1.getWidth() == 200.0) { - b1.setWidth("300px"); - } else { - b1.setWidth("200px"); - - } - b1.setCaption(b1.getWidth() + "px button"); - - } - - }); - b1.setWidth("200px"); - Button b2 = new Button("100% button"); - b2.setWidth("100%"); - - cl.addComponent(b1, "button1"); - cl.addComponent(b2, "button2"); - - layout.addComponent(cl); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2364.java b/uitest/src/com/vaadin/tests/tickets/Ticket2364.java deleted file mode 100644 index 50a2a4329f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2364.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Form; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Select; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2364 extends LegacyApplication { - - @Override - public void init() { - - LegacyWindow main = new LegacyWindow("The Main Window!!!"); - setMainWindow(main); - Form form = new Form(); - VerticalLayout formLayout = new VerticalLayout(); - form.setLayout(formLayout); - Select formSelect = new Select("hello"); - Select select = new Select("hello"); - form.setEnabled(false); - select.setEnabled(false); - formLayout.addComponent(formSelect); - - VerticalLayout l2 = new VerticalLayout(); - l2.addComponent(new Select("hello")); - l2.setEnabled(false); - - form.setCaption("Form"); - main.addComponent(form); - l2.setCaption("VerticalLayout"); - main.addComponent(l2); - main.addComponent(select); - main.addComponent(new Select("Enabled=true select")); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2365.java b/uitest/src/com/vaadin/tests/tickets/Ticket2365.java deleted file mode 100644 index b9e96c2f37..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2365.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2365 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow(getClass() - .getSimpleName()); - setMainWindow(mainWin); - - VerticalLayout lo = new VerticalLayout(); - lo.setSizeFull(); - mainWin.setContent(lo); - - final Panel p = createMultilevelPanel(5, (Panel) null); - - Button b = new Button("Toggle parent level size"); - lo.addComponent(b); - b.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - if (p.getWidth() > 0) { - p.setSizeUndefined(); - } else { - p.setSizeFull(); - } - } - }); - - lo.addComponent(p); - - lo.setExpandRatio(p, 1); - - } - - private Panel createMultilevelPanel(int i, Panel panel) { - if (panel == null) { - VerticalLayout panelLayout = new VerticalLayout(); - panelLayout.setMargin(true); - panel = new Panel("Panel level " + i, panelLayout); - panel.setSizeFull(); - panelLayout.setSizeFull(); - } - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - pl.setSizeFull(); - Panel p = new Panel("Panel level " + i--, pl); - p.setSizeFull(); - pl.addComponent(p); - if (i > 0) { - createMultilevelPanel(i, p); - } - return panel; - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2398.java b/uitest/src/com/vaadin/tests/tickets/Ticket2398.java deleted file mode 100644 index baa2d001b5..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2398.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -public class Ticket2398 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow(); - setMainWindow(mainWin); - - Table t = new Table(); - - IndexedContainer c = new IndexedContainer(); - - c.addItem("foo"); - - c.addContainerProperty("testcol1", Integer.class, new Integer(7)); - c.addContainerProperty("testcol2", String.class, "str"); - c.addContainerProperty("testcol3", String.class, null); - - c.addItem("bar"); - - t.setContainerDataSource(c); - - t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - - mainWin.addComponent(new Label( - "Both rows in table should have same data (default values)")); - - mainWin.addComponent(t); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2404.java b/uitest/src/com/vaadin/tests/tickets/Ticket2404.java deleted file mode 100644 index 7cf3ecd26f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2404.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2404 extends LegacyApplication { - - @Override - public void init() { - - GridLayout gl = new GridLayout(2, 2); - gl.setSizeFull(); - - Button bb = new Button("1st row on 2x2 GridLayout"); - bb.setSizeFull(); - gl.addComponent(bb, 0, 0, 1, 0); - for (int i = 0; i < 2; i++) { - Button b = new Button("" + i); - gl.addComponent(b); - b.setSizeFull(); - } - - setMainWindow(new LegacyWindow("GridLayout test", gl)); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2405.java b/uitest/src/com/vaadin/tests/tickets/Ticket2405.java deleted file mode 100644 index dc288e2d4a..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2405.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.ExternalResource; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.HorizontalSplitPanel; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2405 extends LegacyApplication { - - private Label label; - private HorizontalSplitPanel split; - - @Override - public void init() { - - final LegacyWindow root = new LegacyWindow("VaadinTunes"); - root.setWidth("90%"); - root.setHeight("90%"); - - // We'll attach the window to the browser view already here, so we won't - // forget it later. - // browser.addWindow(root); - setMainWindow(root); - - root.getContent().setSizeFull(); - ((MarginHandler) root.getContent()).setMargin(false); - - // Top area, containing playback and volume controls, play status, view - // modes and search - HorizontalLayout top = new HorizontalLayout(); - // GridLayout top = new GridLayout(1, 1); - top.setWidth("100%"); - top.setMargin(false); - top.setSpacing(false); - - // Let's attach that one straight away too - root.addComponent(top); - - label = new Label( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent porttitor porta lacus. Nulla tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mollis turpis in mauris faucibus posuere. Nullam rutrum, nisi a fermentum tempus, lacus metus rutrum massa, a condimentum mauris justo a tortor. Mauris aliquet, ante quis ultricies posuere, sapien libero laoreet sem, a accumsan diam metus sed elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vehicula metus nec turpis dignissim cursus. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam feugiat orci eget risus. Vestibulum at sem. "); - label.setWidth("100%"); - top.addComponent(label); - split = new HorizontalSplitPanel(); - split.setHeight("100%"); - Embedded image = new Embedded("An image", new ExternalResource( - "http://dev.itmill.com/chrome/site/toolkit-logo.png")); - image.setWidth("100%"); - root.addComponent(split); - ((VerticalLayout) root.getContent()).setExpandRatio(split, 1.0f); - VerticalLayout vl = new VerticalLayout(); - split.addComponent(vl); - - vl.addComponent(new TextField("abc")); - vl.addComponent(image); - vl.setExpandRatio(image, 1.0f); - vl.setComponentAlignment(image, Alignment.BOTTOM_CENTER); - vl.setHeight("100%"); - // We'll need one splitpanel to separate the sidebar and track listing - Button bottomButton = new Button("Filler"); - bottomButton.setSizeFull(); - // root.addComponent(bottomButton); - - // The splitpanel is by default 100% x 100%, but we'll need to adjust - // our main window layout to accomodate the height - root.getContent().setHeight("100%"); - // ((VerticalLayout) root.getLayout()).setExpandRatio(bottomButton, - // 1.0F); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2406.java b/uitest/src/com/vaadin/tests/tickets/Ticket2406.java deleted file mode 100644 index 265b988418..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2406.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2406 extends LegacyApplication { - - private Window w; - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((VerticalLayout) w.getContent()); - } - - private void createUI(VerticalLayout layout) { - w = new Window("A sub window"); - w.setSizeUndefined(); - getMainWindow().addWindow(w); - - VerticalLayout l = new VerticalLayout(); - l.setSizeFull(); - w.setContent(l); - - Button b = new Button("Button 1"); - b.setSizeFull(); - b.addListener(new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - w.setHeight("200px"); - } - - }); - l.addComponent(b); - - for (int i = 0; i < 5; i++) { - b = new Button("Button number " + (i + 2)); - b.setSizeFull(); - l.addComponent(b); - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2407.java b/uitest/src/com/vaadin/tests/tickets/Ticket2407.java deleted file mode 100644 index 0682485915..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2407.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Form; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2407 extends com.vaadin.server.LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow("Ticket2407"); - setMainWindow(main); - - Form form = new Form(new VerticalLayout()); - TextField text = new TextField("This caption shall be visible"); - text.setRequired(true); - form.addField("test", text); - main.addComponent(form); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2411.java b/uitest/src/com/vaadin/tests/tickets/Ticket2411.java deleted file mode 100644 index 6437a1f514..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2411.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2411 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - // VerticalLayout l = new VerticalLayout(); - GridLayout l = new GridLayout(); - w.setContent(l); - - l.setHeight("504px"); - - for (int i = 1; i <= 5; i++) { - Button b = new Button("Button " + i - + " should be 100px or 101px high"); - b.setHeight("100%"); - l.addComponent(b); - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2415.java b/uitest/src/com/vaadin/tests/tickets/Ticket2415.java deleted file mode 100644 index 7019ae6953..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2415.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket2415 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(""); - setMainWindow(main); - - final TextField tf = new TextField("Try to change me"); - main.addComponent(tf); - - tf.setImmediate(true); - tf.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - main.showNotification("New value = " + tf); - } - }); - - final TextField tf2 = new TextField("Try to change me"); - main.addComponent(tf2); - - tf2.setImmediate(true); - tf2.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - main.showNotification("New value = " + tf2); - } - }); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2420.java b/uitest/src/com/vaadin/tests/tickets/Ticket2420.java deleted file mode 100644 index 2dcfb6a34b..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2420.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.ProgressIndicator; - -public class Ticket2420 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow("Hello window"); - setMainWindow(main); - - setTheme("tests-tickets"); - - ProgressIndicator pi = new ProgressIndicator(); - pi.setCaption("Visible"); - pi.setIndeterminate(false); - pi.setValue(new Float(0.5)); - main.addComponent(pi); - - pi = new ProgressIndicator(); - pi.setCaption("Visible (indeterminate)"); - pi.setIndeterminate(true); - - main.addComponent(pi); - - main.addComponent(pi); - - pi = new ProgressIndicator(); - pi.setCaption("Visible (indeterminate, with .redborder css)"); - pi.addStyleName("redborder"); - pi.setIndeterminate(true); - - main.addComponent(pi); - - pi = new ProgressIndicator(); - pi.setCaption("Disabled "); - pi.setEnabled(false); - pi.setIndeterminate(true); - - main.addComponent(pi); - - pi = new ProgressIndicator(); - - pi.setCaption("Hidden (via css)"); - - pi.addStyleName("dispnone"); - - main.addComponent(pi); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2425.java b/uitest/src/com/vaadin/tests/tickets/Ticket2425.java deleted file mode 100644 index 097a91929d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2425.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.VerticalLayout; - -public class Ticket2425 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(getClass().getSimpleName()); - setMainWindow(w); - - w.addComponent(new Label("No scrollbars should be visible anywhere")); - TabSheet ts = new TabSheet(); - ts.addTab(createPanel(), "Panel 1", null); - ts.addTab(createPanel(), "Panel 2", null); - - w.addComponent(ts); - } - - private Panel createPanel() { - VerticalLayout layout = new VerticalLayout(); - layout.setMargin(true); - return new Panel(layout); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2426.java b/uitest/src/com/vaadin/tests/tickets/Ticket2426.java deleted file mode 100644 index a80a8464b6..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2426.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2426 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow w = new LegacyWindow(); - setMainWindow(w); - - final String content = "<select/>"; - - w.addComponent(new Label("CONTENT_DEFAULT: " + content, - ContentMode.TEXT)); - w.addComponent(new Label("CONTENT_PREFORMATTED: " + content, - ContentMode.PREFORMATTED)); - w.addComponent(new Label("CONTENT_RAW: " + content, ContentMode.RAW)); - w.addComponent(new Label("CONTENT_TEXT: " + content, ContentMode.TEXT)); - w.addComponent(new Label("CONTENT_XML: " + content, ContentMode.XML)); - w.addComponent(new Label("CONTENT_XHTML: " + content, ContentMode.HTML)); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2431.java b/uitest/src/com/vaadin/tests/tickets/Ticket2431.java deleted file mode 100644 index 3228dc87ed..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2431.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.event.Action; -import com.vaadin.event.Action.Handler; -import com.vaadin.event.ShortcutAction; -import com.vaadin.event.ShortcutAction.KeyCode; -import com.vaadin.event.ShortcutAction.ModifierKey; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2431 extends LegacyApplication { - - @Override - public void init() { - - LegacyWindow w = new LegacyWindow(); - setMainWindow(w); - Label help = new Label( - "Use CTRL X to fire action, CTRL C to remove it (fails before fix)"); - - w.addComponent(help); - - w.addActionHandler(new Handler() { - - final ShortcutAction a1 = new ShortcutAction("action", KeyCode.X, - new int[] { ModifierKey.CTRL }); - final ShortcutAction a2 = new ShortcutAction("action", KeyCode.C, - new int[] { ModifierKey.CTRL }); - - Action[] actions = new Action[] { a1, a2 }; - - @Override - public Action[] getActions(Object target, Object sender) { - return actions; - } - - @Override - public void handleAction(Action action, Object sender, Object target) { - if (action == a1) { - getMainWindow().addComponent(new Label("CTRL X hit")); - } else { - actions = new Action[] { a2 }; - // annoyance, we need to repaint the panel or detect the - // action in presence in handler - getMainWindow().removeActionHandler(this); - getMainWindow().addActionHandler(this); - } - } - }); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2432.java b/uitest/src/com/vaadin/tests/tickets/Ticket2432.java deleted file mode 100644 index d4c8c31d7f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2432.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Layout.AlignmentHandler; -import com.vaadin.ui.Layout.SpacingHandler; -import com.vaadin.ui.LegacyWindow; - -public class Ticket2432 extends LegacyApplication { - - @Override - public void init() { - - LegacyWindow w = new LegacyWindow(); - setMainWindow(w); - w.getContent().setSizeFull(); - ((SpacingHandler) w.getContent()).setSpacing(true); - - Layout layout = new GridLayout(3, 3); - populateLayout(layout); - w.addComponent(layout); - layout = new HorizontalLayout(); - populateLayout(layout); - w.addComponent(layout); - - } - - private static Alignment[] alignments = new Alignment[] { - Alignment.TOP_LEFT, Alignment.TOP_CENTER, Alignment.TOP_RIGHT, - Alignment.MIDDLE_LEFT, Alignment.MIDDLE_CENTER, - Alignment.MIDDLE_RIGHT, Alignment.BOTTOM_LEFT, - Alignment.BOTTOM_CENTER, Alignment.BOTTOM_RIGHT }; - - private void populateLayout(Layout layout) { - layout.setSizeFull(); - for (int i = 0; i < 9; i++) { - Label l = new Label("M"); - Alignment a = alignments[i]; - l.setCaption(a.getHorizontalAlignment() + " " - + a.getVerticalAlignment() + " " + a.getBitMask()); - layout.addComponent(l); - ((AlignmentHandler) layout).setComponentAlignment(l, a); - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2434.java b/uitest/src/com/vaadin/tests/tickets/Ticket2434.java deleted file mode 100644 index e489e0b02d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2434.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; - -public class Ticket2434 extends LegacyApplication { - - @Override - public void init() { - - LegacyWindow w = new LegacyWindow(); - - setMainWindow(w); - - Table t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, - 50); - - t.setPageLength(0); - - t.addStyleName("bordered"); - - w.addComponent(t); - - setTheme("tests-tickets"); - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2436.java b/uitest/src/com/vaadin/tests/tickets/Ticket2436.java deleted file mode 100644 index ac968db926..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2436.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.PopupView; - -public class Ticket2436 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - final Button remover = new Button("Remove PopupView"); - final PopupView pv = new PopupView(new PopupView.Content() { - @Override - public String getMinimizedValueAsHTML() { - return "PopupView"; - } - - @Override - public Component getPopupComponent() { - return remover; - } - }); - - remover.addListener(new Button.ClickListener() { - @Override - public void buttonClick(Button.ClickEvent event) { - main.removeComponent(pv); - } - }); - - main.addComponent(pv); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2526.java b/uitest/src/com/vaadin/tests/tickets/Ticket2526.java deleted file mode 100644 index 60fa42c2ce..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2526.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Window; - -public class Ticket2526 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - Button b = new Button("Add windows"); - b.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - main.addWindow(new Window()); - } - }); - main.addComponent(b); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2742.java b/uitest/src/com/vaadin/tests/tickets/Ticket2742.java deleted file mode 100644 index de3659540e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2742.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * - */ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.NativeSelect; - -/** - * @author Risto Yrjänä / Vaadin Ltd. - * - */ -public class Ticket2742 extends LegacyApplication { - - /* - * (non-Javadoc) - * - * @see com.vaadin.Application#init() - */ - @Override - public void init() { - LegacyWindow mainWindow = new LegacyWindow(); - setMainWindow(mainWindow); - - String shortString = "Short"; - String longString = "Very, very long"; - - HorizontalLayout hl = new HorizontalLayout(); - - for (int i = 0; i < 2; i++) { - NativeSelect ns = new NativeSelect(shortString); - ns.addItem(longString); - ns.setNullSelectionAllowed(false); - ns.select(longString); - hl.addComponent(ns); - } - mainWindow.addComponent(hl); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2901.java b/uitest/src/com/vaadin/tests/tickets/Ticket2901.java deleted file mode 100644 index 352b4f9a35..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2901.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.VerticalSplitPanel; - -/** - * With IE7 extra scrollbars appear in content area all though content fits - * properly. Scrollbars will disappear if "shaking" content a bit, like - * selecting tests in area. - */ -public class Ticket2901 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow( - "Test app to break layout in IE6"); - setMainWindow(mainWin); - - VerticalSplitPanel sp = new VerticalSplitPanel(); - - VerticalLayout l = new VerticalLayout(); - for (int i = 0; i < 100; i++) { - l.addComponent(new Label("Label" + i)); - } - sp.setFirstComponent(l); - - mainWin.setContent(sp); - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2998.java b/uitest/src/com/vaadin/tests/tickets/Ticket2998.java deleted file mode 100644 index 818a70318e..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2998.java +++ /dev/null @@ -1,330 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.Serializable; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; -import java.util.Set; - -import com.vaadin.data.Container; -import com.vaadin.data.Validator; -import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.DateField; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Layout.MarginHandler; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.Notification; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.themes.Reindeer; - -/** - * Table layout is very slow in Firefox 3.0.10 when the table contains - * components. - * - * This is adapted from the HbnContainer example application WorkoutLog. - * - * Other browsers are much faster. - */ -public class Ticket2998 extends LegacyApplication { - private Table table; - private VerticalLayout mainLayout; - - public class Workout implements Serializable { - private Long id; - private Date date = new Date(); - private String title = " -- new workout -- "; - private float kilometers; - - private String trainingType; - - private Set<String> secondaryTypes; - - public Workout() { - } - - public Long getId() { - return id; - } - - public Date getDate() { - return date; - } - - public void setDate(Date date) { - this.date = date; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public float getKilometers() { - return kilometers; - } - - public void setKilometers(float kilometers) { - this.kilometers = kilometers; - } - - public String getTrainingType() { - return trainingType; - } - - public void setTrainingType(String trainingType) { - this.trainingType = trainingType; - } - - public void setSecondaryTypes(Set<String> secondaryTypes) { - this.secondaryTypes = secondaryTypes; - } - - public Set<String> getSecondaryTypes() { - return secondaryTypes; - } - - } - - public class WorkoutEditor extends Window { - - private DateField date = new DateField("Date"); - private TextField kilomiters = new TextField("Kilometers"); - private TextField title = new TextField("Title/note"); - - private Ticket2998 workoutLog; - - public WorkoutEditor(Ticket2998 app) { - super("Edit workout"); - workoutLog = app; - Layout main = new VerticalLayout(); - setContent(main); - main.setSizeUndefined(); - main.setStyleName(Reindeer.PANEL_LIGHT); - - FormLayout form = new FormLayout(); - form.setSizeUndefined(); - date.setResolution(DateField.RESOLUTION_MIN); - form.addComponent(date); - form.addComponent(kilomiters); - form.addComponent(title); - main.addComponent(form); - - } - - public void loadRun(Workout run) { - if (run == null) { - close(); - } else { - date.setValue(run.getDate()); - kilomiters.setValue(String.valueOf(run.getKilometers())); - title.setValue(run.getTitle()); - if (getParent() == null) { - workoutLog.getMainWindow().addWindow(this); - } - kilomiters.focus(); - } - } - } - - public class MyFieldFactory extends DefaultFieldFactory { - - public MyFieldFactory(Ticket2998 app) { - } - - @Override - public Field<?> createField(Container container, Object itemId, - Object propertyId, Component uiContext) { - - /* - * trainingType is manyToOne relation, give it a combobox - */ - if (propertyId.equals("trainingType")) { - return getTrainingTypeComboboxFor(itemId); - } - - /* - * Secondarytypes is manyToMany relation, give it a multiselect list - */ - if (propertyId.equals("secondaryTypes")) { - return getSecondaryTypesList(itemId); - } - - final Field f = super.createField(container, itemId, propertyId, - uiContext); - if (f != null) { - if (f instanceof TextField) { - TextField tf = (TextField) f; - tf.setWidth("100%"); - } - if (propertyId.equals("kilometers")) { - f.setWidth("4em"); - f.addValidator(new Validator() { - @Override - public void validate(Object value) - throws InvalidValueException { - // FIXME this does not follow the standard pattern - // for validators and has side effects! - try { - @SuppressWarnings("unused") - float f = Float.parseFloat((String) value); - } catch (Exception e) { - Notification.show("Bad number value"); - f.setValue(0); - } - } - }); - } - if (propertyId.equals("date")) { - ((DateField) f).setResolution(DateField.RESOLUTION_MIN); - } - } - return f; - - } - - private Map<Object, ListSelect> workoutIdToList = new HashMap<Object, ListSelect>(); - - private Field<?> getSecondaryTypesList(Object itemId) { - ListSelect list = workoutIdToList.get(itemId); - if (list == null) { - list = new ListSelect(); - list.setMultiSelect(true); - list.addItem("Item1"); - list.addItem("Item2"); - list.addItem("Item3"); - list.addItem("Item4"); - list.addItem("Item5"); - // list.setContainerDataSource(trainingTypes); - list.setRows(4); - workoutIdToList.put(itemId, list); - } - return list; - } - - private Map<Object, ComboBox> workoutIdToCombobox = new HashMap<Object, ComboBox>(); - - private Field<?> getTrainingTypeComboboxFor(Object itemId) { - ComboBox cb = workoutIdToCombobox.get(itemId); - if (cb == null) { - final ComboBox cb2 = new ComboBox(); - cb2.addItem("value1"); - cb2.addItem("value2"); - cb2.addItem("value3"); - cb2.addItem("value4"); - cb2.setNewItemsAllowed(true); - - workoutIdToCombobox.put(itemId, cb2); - cb = cb2; - } - return cb; - } - } - - @Override - public void init() { - buildView(); - setTheme("reindeer"); - } - - /** - * Builds a simple view for application with Table and a row of buttons - * below it. - */ - private void buildView() { - - final LegacyWindow w = new LegacyWindow("Workout Log"); - - // set theme and some layout stuff - setMainWindow(w); - w.getContent().setSizeFull(); - ((MarginHandler) w.getContent()).setMargin(false); - - Panel p = new Panel("Workout Log"); - p.setStyleName(Reindeer.PANEL_LIGHT); - w.addComponent(p); - mainLayout = new VerticalLayout(); - p.setContent(mainLayout); - - populateAndConfigureTable(); - - mainLayout.addComponent(table); - - // make table consume all extra space - p.setSizeFull(); - mainLayout.setSizeFull(); - mainLayout.setExpandRatio(table, 1); - table.setSizeFull(); - } - - protected void populateAndConfigureTable() { - table = new Table(); - - table.setWidth("100%"); - table.setSelectable(true); - table.setImmediate(true); - table.setColumnCollapsingAllowed(true); - table.setColumnWidth("date", 200); - table.setColumnWidth("kilometers", 100); - // table.addListener(this); - table.setTableFieldFactory(new MyFieldFactory(this)); - - loadWorkouts(); - - table.setEditable(true); - } - - /** - * Loads container to Table - */ - protected void loadWorkouts() { - final BeanItemContainer<Workout> cont; - // Use plain HbnContainer - cont = new BeanItemContainer<Workout>(Workout.class); - table.setContainerDataSource(cont); - - // insert some sample data - Calendar c = Calendar.getInstance(); - c.set(Calendar.MILLISECOND, 0); - c.set(Calendar.SECOND, 0); - c.set(Calendar.MINUTE, 0); - - String[] titles = new String[] { "A short easy one", "intervals", - "very long", "just shaking legs after work", - "long one with Paul", "test run" }; - - c.add(Calendar.DATE, -1000); - - Random rnd = new Random(); - - Workout r; - - for (int i = 0; i < 1000; i++) { - r = new Workout(); - c.set(Calendar.HOUR_OF_DAY, - 12 + (rnd.nextInt(11) - rnd.nextInt(11))); - r.setDate(c.getTime()); - r.setTitle(titles[rnd.nextInt(titles.length)]); - r.setKilometers(Math.round(rnd.nextFloat() * 30)); - r.setTrainingType("tt"); - c.add(Calendar.DATE, 1); - cont.addBean(r); - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket3146.java b/uitest/src/com/vaadin/tests/tickets/Ticket3146.java deleted file mode 100644 index b894e6827d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket3146.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Collection; -import java.util.HashSet; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; - -public class Ticket3146 extends LegacyApplication { - - Table table; - TextField result; - - @Override - public void init() { - LegacyWindow mainWindow = new LegacyWindow("Test"); - - table = new Table(); - table.addContainerProperty("Items", String.class, null); - table.addItem(new String[] { "a" }, "a"); - table.addItem(new String[] { "b" }, "b"); - table.addItem(new String[] { "c" }, "c"); - for (int i = 1; i < 100; ++i) { - table.addItem(new String[] { "Item " + i }, "Item " + i); - } - table.setMultiSelect(true); - table.setSelectable(true); - table.setImmediate(true); - table.setHeight("200px"); - table.setWidth("200px"); - mainWindow.addComponent(table); - - Button clearButton = new Button("Clear selection", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - clearSelection(); - } - }); - mainWindow.addComponent(clearButton); - Button clearButton2 = new Button("Clear selection 2", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - clearSelection2(); - } - }); - mainWindow.addComponent(clearButton2); - Button clearButton3 = new Button("Clear selection 3", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - clearSelection3(); - } - }); - mainWindow.addComponent(clearButton3); - Button printButton = new Button("Print selection", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - printSelection(); - } - }); - mainWindow.addComponent(printButton); - - result = new TextField(); - result.setHeight("200px"); - result.setWidth("200px"); - mainWindow.addComponent(result); - - setMainWindow(mainWindow); - } - - void clearSelection() { - table.setValue(null); - } - - void clearSelection2() { - table.setValue(new HashSet<Object>()); - } - - void clearSelection3() { - table.unselect("a"); - table.unselect("b"); - table.unselect("c"); - } - - void printSelection() { - String selection = ""; - for (Object item : (Collection<?>) table.getValue()) { - selection = selection + item + ' '; - } - result.setValue(selection); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket34.java b/uitest/src/com/vaadin/tests/tickets/Ticket34.java deleted file mode 100644 index d095889d6d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket34.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.Page; -import com.vaadin.server.Page.UriFragmentChangedEvent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket34 extends LegacyApplication { - - private Map<String, Component> views = new HashMap<String, Component>(); - private VerticalLayout mainLayout; - private Component currentView; - - @Override - public void init() { - - buildViews(new String[] { "main", "view2", "view3" }); - - mainLayout = new VerticalLayout(); - mainLayout.setSizeFull(); - final LegacyWindow mainWin = new LegacyWindow( - "Test app for URI fragment management/reading", mainLayout); - setMainWindow(mainWin); - - mainWin.getPage().addListener(new Page.UriFragmentChangedListener() { - - @Override - public void uriFragmentChanged(UriFragmentChangedEvent event) { - getMainWindow().showNotification( - "Fragment now: " + event.getUriFragment()); - // try to change to view mapped by fragment string - setView(event.getUriFragment()); - } - }); - - setView("main"); - - } - - private void setView(String string) { - Component component = views.get(string); - if (component == null) { - getMainWindow().showNotification( - "View called " + string + " not found!"); - } else if (component != currentView) { - if (currentView != null) { - mainLayout.replaceComponent(currentView, component); - } else { - mainLayout.addComponent(component); - } - // give all extra space for view - mainLayout.setExpandRatio(component, 1); - currentView = component; - } - } - - private void buildViews(String[] strings) { - for (String string : strings) { - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel(string, pl); - p.setSizeFull(); - pl.setSpacing(true); - pl.addComponent(new Label("This is a simple test case for " - + "UriFragmentReader that can be used for" - + " adding linking, back/forward button " - + "and history support for ajax application. ")); - StringBuffer sb = new StringBuffer(); - sb.append("Available views : "); - for (String key : strings) { - sb.append(key); - sb.append(" "); - } - sb.append("Application will change to them from uri " - + "fragment or server initiated via textfield below."); - pl.addComponent(new Label(sb.toString())); - - final TextField tf = new TextField( - "Type view name (will change to that " - + "view and change the uri fragment)"); - pl.addComponent(tf); - Button b = new Button("Go!"); - pl.addComponent(b); - b.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - String viewName = tf.getValue().toString(); - // fragmentChangedListener will change the view if possible - event.getButton().getUI().getPage() - .setUriFragment(viewName); - } - }); - - views.put(string, p); - } - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5053.java b/uitest/src/com/vaadin/tests/tickets/Ticket5053.java deleted file mode 100644 index 1aae57ebd7..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket5053.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.LegacyWindow; - -/** - * #5053: Last ComboBox item may not be shown if null selection enabled - */ -public class Ticket5053 extends LegacyApplication { - - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - ComboBox combobox = new ComboBox("My ComboBox"); - - // Enable null selection - combobox.setNullSelectionAllowed(true); - // Add the item that marks 'null' value - String nullitem = "-- none --"; - combobox.addItem(nullitem); - // Designate it was the 'null' value marker - combobox.setNullSelectionItemId(nullitem); - - // Add some other items - for (int i = 0; i < 10; i++) { - combobox.addItem("Item " + i); - } - - main.addComponent(combobox); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5157.java b/uitest/src/com/vaadin/tests/tickets/Ticket5157.java deleted file mode 100644 index 47cc7e1c4d..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket5157.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.event.ShortcutAction.KeyCode; -import com.vaadin.event.ShortcutListener; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -/** - * Key codes were converted to lower case on the server (overlapping special key - * codes for function keys etc.) and then back to upper case on the client. - * Therefore, registering e.g. F8 as a key code resulted in "w" being used as - * the trigger and F8 being ignored. - */ -public class Ticket5157 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow mainWindow = new LegacyWindow( - "Forumtests Application"); - setMainWindow(mainWindow); - - VerticalLayout pl = new VerticalLayout(); - pl.setMargin(true); - Panel p = new Panel(pl); - mainWindow.addComponent(p); - - Label l = new Label("Panel with F8 bound"); - pl.addComponent(l); - - TextField f = new TextField(); - pl.addComponent(f); - - p.addAction(new ShortcutListener("F8", KeyCode.F8, null) { - - @Override - public void handleAction(Object sender, Object target) { - mainWindow.showNotification(getCaption()); - - } - }); - - p.addAction(new ShortcutListener("a", KeyCode.A, null) { - - @Override - public void handleAction(Object sender, Object target) { - mainWindow.showNotification(getCaption()); - - } - }); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket5952.java b/uitest/src/com/vaadin/tests/tickets/Ticket5952.java deleted file mode 100644 index f09fb955a1..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket5952.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; - -public class Ticket5952 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow mainWindow = new LegacyWindow( - "Forumtests Application"); - setMainWindow(mainWindow); - - String mathml = "<math mode='display' xmlns='http://www.w3.org/1998/Math/MathML'>" - + "<mrow>" - + " <msup>" - + " <mi>x</mi>" - + " <mn>2</mn>" - + " </msup>" - + " <msup>" - + " <mi>c</mi>" - + " <mn>2</mn>" - + " </msup>" - + " </mrow>" + "</math>"; - Label mathLabel = new Label(mathml, ContentMode.XML); - mainWindow.addComponent(mathLabel); - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket6002.java b/uitest/src/com/vaadin/tests/tickets/Ticket6002.java deleted file mode 100644 index abb72e158c..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket6002.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket6002 extends TestBase { - - @Override - public void setup() { - LegacyWindow main = getMainWindow(); - - final VerticalLayout mainLayout = new VerticalLayout(); - main.setContent(mainLayout); - - mainLayout.addComponent(new Label( - "Replace the floating-point values with an integer")); - - // /////////////////////////////////////////////////// - // Better working case - - final ObjectProperty<Double> property1 = new ObjectProperty<Double>( - new Double(42.0)); - - // A text field that changes its caption - final TextField tf1 = new TextField( - "Changing this field modifies only the textfield", property1); - tf1.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - // This value change event is called twice if the new - // input value is an integer. The second time is during - // paint() of AbstractOrderedLayout. - - System.out.println("Value 2 is: " + property1.getValue()); - - tf1.setCaption("With caption " + property1.getValue()); - } - }); - tf1.setImmediate(true); - mainLayout.addComponent(tf1); - - // /////////////////////////////////////////////////// - // Totally failing case - - final ObjectProperty<Double> property2 = new ObjectProperty<Double>( - new Double(42.0)); - - // A text field that adds new components - final TextField tf2 = new TextField( - "Changing this field modifies the layout - do it twice", - property2); - tf2.addListener(new Property.ValueChangeListener() { - - @Override - public void valueChange(ValueChangeEvent event) { - // This value change event is called twice if the new - // input value is an integer. The second time is during - // paint() of AbstractOrderedLayout. - - System.out.println("Value 1 is: " + property2.getValue()); - - // When this listener is called the second time in paint(), the - // add operation causes a ConcurrentModificationException - mainLayout.addComponent(new Label( - "Added a component, value is " + property2.getValue())); - } - }); - tf2.setImmediate(true); - mainLayout.addComponent(tf2); - - mainLayout.setSpacing(true); - } - - @Override - protected String getDescription() { - return "Change the numbers to integer value or add 0 in the decimal representation. " - + "This causes a secondary call during paint() to reformat the value, which causes ConcurrentModificationException in the second case."; - } - - @Override - protected Integer getTicketNumber() { - return 6002; - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket677.java b/uitest/src/com/vaadin/tests/tickets/Ticket677.java deleted file mode 100644 index 44ec3d10da..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket677.java +++ /dev/null @@ -1,226 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.util.BeanItem; -import com.vaadin.server.LegacyApplication; -import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Component; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.DefaultFieldFactory; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; - -public class Ticket677 extends LegacyApplication { - - private static final Label info = new Label( - "<li> keep debug window open to see variable changes" - + "<li> disable root panel w/ toggle button" - + "<li> toggle one of the subpanels" - + "<li> we attempt to focus the subpanels first textfield" - + "<li> focusing should fail (try tabbing as well) [worked previousy]" - + "<li> no variable changes should be sent from disabled fields [changed sent previously]" - + "<li> try further toggling and tabbing around", - ContentMode.RAW); - - Panel root = new Panel("Enabled"); - Panel one = new Panel("Enabled"); - Panel two = new Panel("Enabled"); - Form form; - Table table; - - @Override - public void init() { - LegacyWindow main = new LegacyWindow(); - setMainWindow(main); - - main.addComponent(info); - - HorizontalLayout l = new HorizontalLayout(); - main.addComponent(l); - - l.addComponent(new Button("Toggle root panel", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - toggle(root); - } - })); - l.addComponent(new Button("Toggle panel one", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - toggle(one); - } - })); - l.addComponent(new Button("Toggle panel two", - new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - toggle(two); - } - })); - l.addComponent(new Button("Toggle form", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - toggle(form); - } - })); - l.addComponent(new Button("Toggle table", new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - toggle(table); - } - })); - - GridLayout content = new GridLayout(2, 3); - root.setContent(content); - main.addComponent(root); - - TextField tf = new TextField("Enabled"); - tf.setImmediate(true); - content.addComponent(tf); - tf = new TextField("Disabled"); - tf.setImmediate(true); - tf.setEnabled(false); - content.addComponent(tf); - - VerticalLayout oneLayout = new VerticalLayout(); - oneLayout.setMargin(true); - one.setContent(oneLayout); - - content.addComponent(one); - tf = new TextField("Enabled"); - tf.setImmediate(true); - oneLayout.addComponent(tf); - tf = new TextField("Disabled"); - tf.setImmediate(true); - tf.setEnabled(false); - oneLayout.addComponent(tf); - - VerticalLayout twoLayout = new VerticalLayout(); - twoLayout.setMargin(true); - two.setContent(twoLayout); - - content.addComponent(two); - tf = new TextField("Enabled"); - tf.setImmediate(true); - twoLayout.addComponent(tf); - tf = new TextField("Disabled"); - tf.setImmediate(true); - tf.setEnabled(false); - twoLayout.addComponent(tf); - - form = new Form(); - form.setCaption("Enabled"); - form.setFormFieldFactory(new DefaultFieldFactory() { - - @Override - public Field<?> createField(Item item, Object propertyId, - Component uiContext) { - Field<?> f = super.createField(item, propertyId, uiContext); - f.setEnabled(!"disabled".equals(propertyId)); - return f; - } - - }); - form.setItemDataSource(new BeanItem<MyBean>(new MyBean())); - content.addComponent(form); - - table = new Table("Enabled"); - table.setPageLength(7); - table.addContainerProperty("Text", String.class, null); - for (int i = 0; i < 150; i++) { - Item item = table.addItem("Item" + i); - Property<String> p = item.getItemProperty("Text"); - p.setValue(i % 5 == 0 ? "enabled" : "disabled"); - } - - table.setTableFieldFactory(new DefaultFieldFactory() { - - @Override - public Field<?> createField(Container container, Object itemId, - Object propertyId, Component uiContext) { - Field<?> f = super.createField(container, itemId, propertyId, - uiContext); - Item item = container.getItem(itemId); - Property<?> p = item.getItemProperty(propertyId); - if ("disabled".equals(p.getValue())) { - f.setEnabled(false); - } - return f; - } - - }); - table.setEditable(true); - content.addComponent(table); - - } - - private void toggle(Component c) { - boolean enable = "Disabled".equals(c.getCaption()); - c.setEnabled(enable); - c.setCaption((enable ? "Enabled" : "Disabled")); - if (c instanceof ComponentContainer) { - TextField tf = (TextField) ((ComponentContainer) c) - .getComponentIterator().next(); - tf.focus(); - } - } - - class MyBean { - boolean on = false; - int number = 1; - String rw = "read/write"; - String r = "read"; - String disabled = "disabled"; - - public boolean isOn() { - return on; - } - - public void setOn(boolean on) { - this.on = on; - } - - public int getNumber() { - return number; - } - - public void setNumber(int number) { - this.number = number; - } - - public String getRw() { - return rw; - } - - public void setRw(String rw) { - this.rw = rw; - } - - public String getDisabled() { - return disabled; - } - - public void setDisabled(String disabled) { - this.disabled = disabled; - } - - public String getR() { - return r; - } - - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket695.java b/uitest/src/com/vaadin/tests/tickets/Ticket695.java deleted file mode 100644 index d5ae9bb09f..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket695.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectOutputStream; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.LegacyWindow; - -@SuppressWarnings("serial") -public class Ticket695 extends LegacyApplication { - - @Override - public void init() { - final LegacyWindow w = new LegacyWindow("Serialization test #695"); - setMainWindow(w); - Button b = new Button("Serialize ApplicationContext"); - w.addComponent(b); - b.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - try { - ObjectOutputStream oos = new ObjectOutputStream(buffer); - long t = System.currentTimeMillis(); - oos.writeObject(getContext()); - w.showNotification("ApplicationContext serialized (" - + buffer.size() + "bytes) in " - + (System.currentTimeMillis() - t) + "ms"); - } catch (IOException e) { - e.printStackTrace(); - w.showNotification("ApplicationContext serialization failed - see console for stacktrace"); - } - - } - }); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket736.java b/uitest/src/com/vaadin/tests/tickets/Ticket736.java deleted file mode 100644 index 6acd43c312..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket736.java +++ /dev/null @@ -1,189 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Validator; -import com.vaadin.data.util.BeanItem; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.data.validator.IntegerValidator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.server.ThemeResource; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Form; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; - -public class Ticket736 extends LegacyApplication { - - Address address = new Address(); - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow("Test app for #736"); - setMainWindow(mainWin); - - setTheme("runo"); - - // Create form for editing address - final Form f = new Form(); - f.setItemDataSource(new BeanItem<Address>(address, new String[] { - "name", "street", "zip", "city", "state", "country" })); - f.setCaption("Office address"); - f.setIcon(new ThemeResource("../runo/icons/16/document.png")); - f.setDescription("Jep jpe, this is form description."); - mainWin.addComponent(f); - - // Select to use buffered mode for editing to enable commit and discard - f.setBuffered(true); - Button commit = new Button("Commit", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - f.commit(); - } - }); - Button discard = new Button("Discard", new ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - f.discard(); - } - - }); - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight("3em"); - ol.addComponent(commit); - ol.setComponentAlignment(commit, Alignment.TOP_RIGHT); - ol.addComponent(discard); - f.setFooter(ol); - - // Add some validators for the form - f.getField("zip").addValidator( - new IntegerValidator("'{0}' is not a number")); - ((AbstractComponent) f.getField("zip")).setDescription("Jepjep"); - ((AbstractComponent) f.getField("zip")).setIcon(new ThemeResource( - "../runo/icons/16/folder.png")); - f.getField("state").addValidator(new IsValidState()); - f.getField("name").setRequired(true); - f.getField("street").setRequired(true); - f.getField("city").setRequired(true); - f.getField("zip").setRequired(true); - - // Debug form properties - final VerticalLayout formPropertiesLayout = new VerticalLayout(); - formPropertiesLayout.setMargin(true); - final Panel formProperties = new Panel("Form properties", - formPropertiesLayout); - formProperties.setWidth("200px"); - final String[] visibleProps = { "required", "invalidAllowed", - "readOnly", "readThrough", "writeThrough", "invalidCommitted", - "validationVisible", "immediate" }; - for (int i = 0; i < visibleProps.length; i++) { - CheckBox b = new CheckBox(visibleProps[i], - new MethodProperty<Boolean>(f, visibleProps[i])); - b.setImmediate(true); - formPropertiesLayout.addComponent(b); - } - mainWin.addComponent(formProperties); - - // Debug the internal state of the address-object - mainWin.addComponent(new Button("Show state of the address object", - new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - mainWin.showNotification(address.toString()); - } - })); - } - - /** Address pojo. */ - public static class Address { - String name = ""; - String street = ""; - String zip = ""; - String city = ""; - String state = ""; - String country = ""; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getStreet() { - return street; - } - - public void setStreet(String street) { - this.street = street; - } - - public String getZip() { - return zip; - } - - public void setZip(String zip) { - this.zip = zip; - } - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city = city; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country = country; - } - - @Override - public String toString() { - return name + "; " + street + "; " + city + " " + zip - + (state != null ? " " + state : "") + " " + country; - } - - } - - /** Simple state validator */ - static class IsValidState implements Validator { - - @Override - public void validate(Object value) throws InvalidValueException { - // Empty and null are accepted values - if (value == null || "".equals("" + value)) { - return; - } - - // Otherwise state must be two capital letter combo - if (value.toString().length() != 2 - || !value.toString().equals(("" + value).toUpperCase())) { - throw new InvalidValueException( - "State must be either two capital letter abreviation or left empty"); - } - } - } -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket8291.java b/uitest/src/com/vaadin/tests/tickets/Ticket8291.java deleted file mode 100644 index 8667475f14..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket8291.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import com.vaadin.data.Container.Filter; -import com.vaadin.data.Item; -import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.server.VaadinRequest; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.UI; - -/** - * Test for #8291 and #7666: NegativeArraySizeException when Table scrolled to - * the end and its size reduced. - */ -public class Ticket8291 extends UI { - - @Override - public void init(VaadinRequest request) { - setContent(new TestView()); - } - - private static class DecimateFilter implements Filter { - @Override - public boolean passesFilter(Object itemId, Item item) - throws UnsupportedOperationException { - return ((((TestObject) itemId).property3 % 10) == 0); - } - - @Override - public boolean appliesToProperty(Object propertyId) { - return true; - } - } - - private static class TestView extends HorizontalLayout { - - private Filter filter = null; - - private boolean reduceData; - - private TestView() { - final Table table = new Table(); - List<TestObject> data = createData(1000); - final BeanItemContainer<TestObject> container = new BeanItemContainer<TestObject>( - TestObject.class, data) { - - @Override - public int size() { - if (reduceData) { - return 100; - } else { - return super.size(); - } - } - }; - table.setContainerDataSource(container); - addComponent(table); - Button button = new Button("Click"); - button.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - reduceData = !reduceData; - table.refreshRowCache(); - } - }); - addComponent(button); - Button button2 = new Button("Filter"); - button2.addListener(new Button.ClickListener() { - @Override - public void buttonClick(ClickEvent event) { - if (filter != null) { - container.removeAllContainerFilters(); - filter = null; - } else { - filter = new DecimateFilter(); - container.addContainerFilter(filter); - } - table.refreshRowCache(); - } - }); - addComponent(button2); - } - } - - private static List<TestObject> createData(int count) { - ArrayList<TestObject> data = new ArrayList<TestObject>(count); - for (int i = 0; i < count; i++) { - data.add(new TestObject("string-" + i, new Date(), i)); - } - return data; - } - - public static class TestObject { - - private String property1; - private Date property2; - private Integer property3; - - public TestObject(String property1, Date property2, Integer property3) { - this.property1 = property1; - this.property2 = property2; - this.property3 = property3; - } - - public String getProperty1() { - return property1; - } - - public Date getProperty2() { - return property2; - } - - public Integer getProperty3() { - return property3; - } - - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket846.java b/uitest/src/com/vaadin/tests/tickets/Ticket846.java deleted file mode 100644 index adc5663a8a..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket846.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.MethodProperty; -import com.vaadin.data.validator.IntegerValidator; -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextField; - -public class Ticket846 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow("Test app for #846"); - setMainWindow(mainWin); - - final TextField tx = new TextField("Integer"); - mainWin.addComponent(tx); - tx.setImmediate(true); - tx.addValidator(new IntegerValidator("{0} is not a number")); - - final String[] visibleProps = { "required", "invalidAllowed", - "readOnly", "readThrough", "invalidCommitted", - "validationVisible" }; - for (int i = 0; i < visibleProps.length; i++) { - CheckBox b = new CheckBox(visibleProps[i], - new MethodProperty<Boolean>(tx, visibleProps[i])); - b.setImmediate(true); - mainWin.addComponent(b); - } - - // tx.setIcon(new ThemeResource("icons/16/folder.png")); - - mainWin.addComponent(new Button("Validate integer", - new Button.ClickListener() { - @Override - public void buttonClick( - com.vaadin.ui.Button.ClickEvent event) { - mainWin.showNotification("The field is " - + (tx.isValid() ? "" : "not ") + "valid"); - } - })); - TextField caption = new TextField("Caption", - new MethodProperty<String>(tx, "caption")); - caption.setImmediate(true); - mainWin.addComponent(caption); - } - -} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket932.java b/uitest/src/com/vaadin/tests/tickets/Ticket932.java deleted file mode 100644 index 59c663e618..0000000000 --- a/uitest/src/com/vaadin/tests/tickets/Ticket932.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.server.LegacyApplication; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.LegacyWindow; -import com.vaadin.ui.TextArea; -import com.vaadin.ui.TextField; - -public class Ticket932 extends LegacyApplication { - - @Override - public void init() { - - final LegacyWindow mainWin = new LegacyWindow( - "Test app for max length feature"); - setMainWindow(mainWin); - - final TextField tx = new TextField( - "Textfield with maxlenght 10, single row"); - tx.setImmediate(true); - tx.setMaxLength(10); - - final Label l = new Label(); - - Button b = new Button("Check value"); - b.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - l.setValue("Length: " + tx.getValue().toString().length() - + " Content: " + tx.getValue()); - } - }); - - mainWin.addComponent(tx); - mainWin.addComponent(b); - - final TextArea tx2 = new TextArea( - "Textfield with maxlenght 10, multirow "); - mainWin.addComponent(tx2); - tx2.setImmediate(true); - tx2.setRows(5); - tx2.setMaxLength(10); - - Button b2 = new Button("Check value"); - b2.addListener(new Button.ClickListener() { - - @Override - public void buttonClick(ClickEvent event) { - l.setValue("Length: " + tx2.getValue().toString().length() - + " Content: " + tx2.getValue()); - } - }); - - mainWin.addComponent(tx); - mainWin.addComponent(b); - - mainWin.addComponent(l); - - } - -} |