From d5a3968dcee947d1bd0781de49b0caf170b51525 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 6 Feb 2012 12:51:06 +0000 Subject: [merge from 6.7] #8284, #8336 Removed dead code svn changeset:22928/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/Util.java | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index 60afcc2839..e033e5adfe 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -1331,7 +1331,6 @@ public class Util { * button, false otherwise */ public static boolean isTouchEventOrLeftMouseButton(Event event) { - int eventType = event.getTypeInt(); boolean touchEvent = Util.isTouchEvent(event); return touchEvent || event.getButton() == Event.BUTTON_LEFT; } -- cgit v1.2.3 From 8d761b45cc1f677a735aed4d8a80de70464772ce Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 6 Feb 2012 14:37:21 +0000 Subject: #8216 Fixed widgetset compilation warning svn changeset:22936/svn branch:6.8 --- src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml index 7844ccecf1..cebfd8a679 100644 --- a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml +++ b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml @@ -56,6 +56,13 @@ + + + + + Date: Mon, 13 Feb 2012 09:45:38 +0000 Subject: [merge from 6.7] #8362 Ensure value is not toggled when checkbox is disabled svn changeset:22978/svn branch:6.8 --- .../vaadin/terminal/gwt/client/ui/VCheckBox.java | 5 +- .../CheckBoxDisabledReadOnlyValueChange.html | 147 +++++++++++++++++++++ 2 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxDisabledReadOnlyValueChange.html (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java b/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java index c43c4d3dba..b1eda728dc 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCheckBox.java @@ -162,7 +162,10 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements public void onBrowserEvent(Event event) { if (icon != null && (event.getTypeInt() == Event.ONCLICK) && (DOM.eventGetTarget(event) == icon.getElement())) { - setValue(!getValue()); + // Click on icon should do nothing if widget is disabled + if (isEnabled()) { + setValue(!getValue()); + } } super.onBrowserEvent(event); if (event.getTypeInt() == Event.ONLOAD) { diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxDisabledReadOnlyValueChange.html b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxDisabledReadOnlyValueChange.html new file mode 100644 index 0000000000..ddcdc68691 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxDisabledReadOnlyValueChange.html @@ -0,0 +1,147 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.checkbox.CheckBoxes2?restartApplication
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_Smenu#item032,11
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[0]/VMenuBar[0]#item150,4
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[1]/VMenuBar[0]#item348,6
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[2]/VMenuBar[0]#item124,9
assertValuevaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[0]off
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[1]9,7
assertValuevaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[0]on
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_Smenu#item022,11
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[0]/VMenuBar[0]#item033,5
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[1]/VMenuBar[0]#item151,9
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[2]8,7
assertValuevaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[0]on
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[1]5,10
assertValuevaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[0]on
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_Smenu#item033,14
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[0]/VMenuBar[0]#item030,3
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[1]/VMenuBar[0]#item162,4
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_Smenu#item042,4
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[0]/VMenuBar[0]#item040,9
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::Root/VOverlay[1]/VMenuBar[0]#item258,14
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[2]8,7
assertValuevaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[0]on
mouseClickvaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[1]5,10
assertValuevaadin=runcomvaadintestscomponentscheckboxCheckBoxes2::PID_StestComponent/domChild[0]on
+ + -- cgit v1.2.3 From f5834102cf6e75e1d05546001015585868a38a63 Mon Sep 17 00:00:00 2001 From: Automerge Date: Mon, 13 Feb 2012 14:14:29 +0000 Subject: [merge from 6.7] #8240 Chrome 17 on a desktop was detected as a touch device svn changeset:22983/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/BrowserInfo.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java index fd80b917df..844b4f2e96 100644 --- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java +++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java @@ -66,13 +66,23 @@ public class BrowserInfo { browserDetails.setIEMode(documentMode); } } - touchDevice = detectTouchDevice(); + + if (browserDetails.isChrome()) { + touchDevice = detectChromeTouchDevice(); + } else { + touchDevice = detectTouchDevice(); + } } private native boolean detectTouchDevice() /*-{ try { document.createEvent("TouchEvent");return true;} catch(e){return false;}; }-*/; + + private native boolean detectChromeTouchDevice() + /*-{ + return ("ontouchstart" in window); + }-*/; private native int getIEDocumentMode() /*-{ -- cgit v1.2.3 From 36f749b4f83086a5306726ad607c9bb3a0fa7526 Mon Sep 17 00:00:00 2001 From: Automerge Date: Mon, 13 Feb 2012 14:14:37 +0000 Subject: [merge from 6.7] #8264 fix long range selection in multi-selectable table, related test svn changeset:22984/svn branch:6.8 --- .../terminal/gwt/client/ui/VScrollTable.java | 5 +- .../tests/components/table/LongMultiselect.html | 72 +++++++++++++++++++++ .../tests/components/table/LongMultiselect.java | 74 ++++++++++++++++++++++ 3 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/table/LongMultiselect.html create mode 100644 tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index ee9c03d421..cae0b65a5a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -257,9 +257,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, int endOfFirstRange = row.getIndex() - 1; if (!(endOfFirstRange - startRow.getIndex() < 0)) { // create range of first part unless its length is < 1 - VScrollTableRow endOfRange = scrollBody - .getRowByRowIndex(endOfFirstRange); - ranges.add(new SelectionRange(startRow, endOfRange)); + ranges.add(new SelectionRange(startRow, endOfFirstRange + - startRow.getIndex() + 1)); } int startOfSecondRange = row.getIndex() + 1; if (!(getEndIndex() - startOfSecondRange < 0)) { diff --git a/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.html b/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.html new file mode 100644 index 0000000000..82778d5bac --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.html @@ -0,0 +1,72 @@ + + + + + + +LongMultiselect + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LongMultiselect
open/run/com.vaadin.tests.components.table.LongMultiselect?restartApplication
mouseClickvaadin=runcomvaadintestscomponentstableLongMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[4]/domChild[1]38,13
scrollvaadin=runcomvaadintestscomponentstableLongMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]18330
pause300
scrollvaadin=runcomvaadintestscomponentstableLongMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]18330
pause300
mouseClickvaadin=runcomvaadintestscomponentstableLongMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[22]/domChild[0]/domChild[0]41,-1823:shift
clickvaadin=runcomvaadintestscomponentstableLongMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]
screenCaptureselected-5-99
assertTextvaadin=runcomvaadintestscomponentstableLongMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[18]/domChild[1]/domChild[0]updated
assertTextvaadin=runcomvaadintestscomponentstableLongMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[19]/domChild[1]
+ + diff --git a/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java b/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java new file mode 100644 index 0000000000..4db9b69070 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java @@ -0,0 +1,74 @@ +package com.vaadin.tests.components.table; + +import java.util.Collection; + +import com.vaadin.Application; +import com.vaadin.data.Property; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; +import com.vaadin.ui.Table; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; + +public class LongMultiselect extends TestBase { + + private enum ItemProperty { + COLUMN1, + COLUMN2 + } + + @Override + protected void setup() { + VerticalLayout layout = generateLayout(); + addComponent(layout); + layout.setSizeFull(); + } + + private VerticalLayout generateLayout() { + VerticalLayout layout = new VerticalLayout(); + + final Table table = new Table("Ticket #8264 table"); + layout.addComponent(table); + table.setWidth("200px"); + table.setHeight("170px"); + table.setSelectable(true); + table.setMultiSelect(true); + table.setImmediate(true); + + // Create example data + table.addContainerProperty(ItemProperty.COLUMN1, String.class, null); + table.addContainerProperty(ItemProperty.COLUMN2, String.class, null); + for (int i=1;i<100;i++) { + table.addItem(new String[]{"Item " + i, null}, i); + } + + //Add action button + layout.addComponent(new Button("Do It", new Button.ClickListener() { + public void buttonClick(Button.ClickEvent event) { + // Set ItemProperty.COLUMN2 for all selected values of table + Collection selectedIds = (Collection)table.getValue(); + for (final Object itemId : selectedIds) { + final Property p = table.getItem(itemId).getItemProperty(ItemProperty.COLUMN2); + if (p.getValue() instanceof String) { + p.setValue(null); + } else { + p.setValue("updated"); + } + } + } + })); + + return layout; + } + + @Override + protected String getDescription() { + return "Multiselecting 94 rows (from \"item 5\" to \"item 98\") and modifying second column of each row selected (press Do It). This should work (update the 2nd column) and not cause JS exception."; + } + + @Override + protected Integer getTicketNumber() { + return 8264; + } +} -- cgit v1.2.3 From cc4914f4969141fcdc92f636ccb67b84c99f32f7 Mon Sep 17 00:00:00 2001 From: Automerge Date: Tue, 14 Feb 2012 14:06:37 +0000 Subject: [merge from 6.7] #5833 and #7013 combo box width fix and tests svn changeset:23000/svn branch:6.8 --- .../terminal/gwt/client/ui/VFilterSelect.java | 28 +++++---- .../tests/components/combobox/PopUpWidth.html | 57 ++++++++++++++++++ .../tests/components/combobox/PopUpWidth.java | 43 ++++++++++++++ .../components/combobox/WidthToggleReadOnly.html | 67 ++++++++++++++++++++++ .../components/combobox/WidthToggleReadOnly.java | 48 ++++++++++++++++ 5 files changed, 232 insertions(+), 11 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.html create mode 100644 tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java create mode 100644 tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.html create mode 100644 tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.java (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java index e261286cb7..5cf02532b1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java @@ -1842,14 +1842,6 @@ public class VFilterSelect extends Composite implements Paintable, Field, */ int tbWidth = Util.getRequiredWidth(tb); - if (popupWidth < 0) { - /* - * Only use the first page popup width so the textbox will not - * get resized whenever the popup is resized. - */ - popupWidth = Util.getRequiredWidth(popupOpener); - } - /* * Note: iconWidth is here calculated as a negative pixel value so * you should consider this in further calculations. @@ -1858,7 +1850,7 @@ public class VFilterSelect extends Composite implements Paintable, Field, .measureMarginLeft(tb.getElement()) - Util.measureMarginLeft(selectedItemIcon.getElement()) : 0; - int w = tbWidth + popupWidth + iconWidth; + int w = tbWidth + getPopUpOpenerWidth() + iconWidth; /* * When the select has a undefined with we need to check that we are @@ -1894,6 +1886,20 @@ public class VFilterSelect extends Composite implements Paintable, Field, } } + /** + * Only use the first page popup width so the textbox will not get resized + * whenever the popup is resized. This also resolves issue where toggling + * combo box between read only and normal state makes it grow larger. + * + * @return Width of popup opener + */ + private int getPopUpOpenerWidth() { + if (popupWidth < 0) { + popupWidth = Util.getRequiredWidth(popupOpener); + } + return popupWidth; + } + /** * Get the width of the select in pixels where the text area and icon has * been included. @@ -1921,10 +1927,10 @@ public class VFilterSelect extends Composite implements Paintable, Field, */ private void setTextboxWidth(int componentWidth) { int padding = getTextboxPadding(); - int popupOpenerWidth = Util.getRequiredWidth(popupOpener); int iconWidth = selectedItemIcon.isAttached() ? Util .getRequiredWidth(selectedItemIcon) : 0; - int textboxWidth = componentWidth - padding - popupOpenerWidth + + int textboxWidth = componentWidth - padding - getPopUpOpenerWidth() - iconWidth; if (textboxWidth < 0) { textboxWidth = 0; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.html b/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.html new file mode 100644 index 0000000000..35a6bcf29a --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.html @@ -0,0 +1,57 @@ + + + + + + +PopUpWidth + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PopUpWidth
open/run/com.vaadin.tests.components.combobox.PopUpWidth
mouseClickvaadin=runcomvaadintestscomponentscomboboxPopUpWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VFilterSelect[0]/domChild[1]9,14
mouseClickvaadin=runcomvaadintestscomponentscomboboxPopUpWidth::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]106,5
mouseClickvaadin=runcomvaadintestscomponentscomboboxPopUpWidth::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]103,5
mouseClickvaadin=runcomvaadintestscomponentscomboboxPopUpWidth::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]103,5
mouseClickvaadin=runcomvaadintestscomponentscomboboxPopUpWidth::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]103,5
mouseClickvaadin=runcomvaadintestscomponentscomboboxPopUpWidth::Root/VFilterSelect$SuggestionPopup[0]/domChild[0]/domChild[2]/domChild[0]103,5
screenCapturecombos-and-popup-with-same-width
+ + diff --git a/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java b/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java new file mode 100644 index 0000000000..e22482ed8b --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java @@ -0,0 +1,43 @@ +package com.vaadin.tests.components.combobox; + +import com.vaadin.data.Item; +import com.vaadin.terminal.Resource; +import com.vaadin.terminal.ThemeResource; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.ComboBox; + +public class PopUpWidth extends TestBase { + + @Override + protected void setup() { + + addComponent(createComboBox("Do not touch this")); + addComponent(createComboBox("Browse this (check that width does not change)")); + } + + private ComboBox createComboBox(String caption) { + ComboBox cb = new ComboBox(caption); + cb.addContainerProperty("caption", String.class, null); + cb.addContainerProperty("icon", Resource.class, null); + for (int i = 1; i < 200 + 1; i++) { + Item item = cb.addItem(i); + item.getItemProperty("caption").setValue("Item " + i); + item.getItemProperty("icon").setValue( + new ThemeResource("../runo/icons/16/users.png")); + } + cb.setItemIconPropertyId("icon"); + cb.setItemCaptionPropertyId("caption"); + return cb; + } + + @Override + protected String getDescription() { + return "Check that width of popup or combobox does not change when paging."; + } + + @Override + protected Integer getTicketNumber() { + return 7013; + } + +} diff --git a/tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.html b/tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.html new file mode 100644 index 0000000000..b661aa2bd7 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.html @@ -0,0 +1,67 @@ + + + + + + +WidthToggleReadOnly + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
WidthToggleReadOnly
open/run/com.vaadin.tests.components.combobox.WidthToggleReadOnly
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
mouseClickvaadin=runcomvaadintestscomponentscomboboxWidthToggleReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]5,7
screenCaptureboth-combo-with-same-width
+ + diff --git a/tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.java b/tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.java new file mode 100644 index 0000000000..654f42e233 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/combobox/WidthToggleReadOnly.java @@ -0,0 +1,48 @@ +package com.vaadin.tests.components.combobox; + +import com.vaadin.data.util.MethodProperty; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.ComboBox; + +public class WidthToggleReadOnly extends TestBase { + + @Override + protected void setup() { + ComboBox combo = createNewComboBoxA("Untouched combobox"); + addComponent(combo); + + combo = createNewComboBoxA("Toggled combobox"); + addComponent(combo); + addComponent(createReadOnlyForComboBox(combo)); + } + + private ComboBox createNewComboBoxA(String caption) { + ComboBox combo = new ComboBox(caption); + combo.addItem("first"); + combo.setValue("first"); + + addComponent(combo); + + return combo; + } + + private CheckBox createReadOnlyForComboBox(ComboBox combo) { + CheckBox readonly = new CheckBox("Second combobox is read only", + new MethodProperty(combo, "readOnly")); + readonly.setImmediate(true); + addComponent(readonly); + return readonly; + } + + @Override + protected String getDescription() { + return "Check that toggling read only mode of second combobox does not change it's width."; + } + + @Override + protected Integer getTicketNumber() { + return 5833; + } + +} -- cgit v1.2.3 From b495b8f7f4d4cf1ea1731b45d1cf6e35bdd86779 Mon Sep 17 00:00:00 2001 From: Automerge Date: Tue, 14 Feb 2012 22:08:42 +0000 Subject: [merge from 6.7] #8392 Improved error message for exceptions that take place in listener code svn changeset:23006/svn branch:6.8 --- src/com/vaadin/event/ListenerMethod.java | 49 ++++---------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/event/ListenerMethod.java b/src/com/vaadin/event/ListenerMethod.java index c11f3b1424..1f1305fa69 100644 --- a/src/com/vaadin/event/ListenerMethod.java +++ b/src/com/vaadin/event/ListenerMethod.java @@ -517,8 +517,10 @@ public class ListenerMethod implements EventListener, Serializable { } catch (final java.lang.reflect.InvocationTargetException e) { // An exception was thrown by the invocation target. Throw it // forwards. - throw new MethodException("Invocation of method " + method - + " failed.", e.getTargetException()); + throw new MethodException("Invocation of method " + + method.getName() + " in " + + target.getClass().getName() + " failed.", + e.getTargetException()); } } } @@ -617,49 +619,8 @@ public class ListenerMethod implements EventListener, Serializable { public class MethodException extends RuntimeException implements Serializable { - private final Throwable cause; - - private String message; - private MethodException(String message, Throwable cause) { - super(message); - this.cause = cause; - } - - /** - * Retrieves the cause of this throwable or null if the - * cause does not exist or not known. - * - * @return the cause of this throwable or null if the cause - * is nonexistent or unknown. - * @see java.lang.Throwable#getCause() - */ - @Override - public Throwable getCause() { - return cause; - } - - /** - * Returns the error message string of this throwable object. - * - * @return the error message. - * @see java.lang.Throwable#getMessage() - */ - @Override - public String getMessage() { - return message; - } - - /** - * @see java.lang.Throwable#toString() - */ - @Override - public String toString() { - String msg = super.toString(); - if (cause != null) { - msg += "\nCause: " + cause.toString(); - } - return msg; + super(message, cause); } } -- cgit v1.2.3 From 5b2e12623424e3603a5983895d122ba333db5b18 Mon Sep 17 00:00:00 2001 From: Automerge Date: Wed, 15 Feb 2012 02:18:42 +0000 Subject: [merge from 6.7] #8373 Handler DragAndDropService changeVariables error by finding the drop target and using that for error reporting svn changeset:23013/svn branch:6.8 --- .../terminal/gwt/server/AbstractCommunicationManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index e96f2d2b56..4454287ae9 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1396,12 +1396,16 @@ public abstract class AbstractCommunicationManager implements } } } catch (Exception e) { + Component errorComponent = null; if (owner instanceof Component) { - handleChangeVariablesError(app, (Component) owner, e, m); - } else { - // TODO DragDropService error handling - throw new RuntimeException(e); + errorComponent = (Component) owner; + } else if (owner instanceof DragAndDropService) { + if (m.get("dhowner") instanceof Component) { + errorComponent = (Component) m.get("dhowner"); + } } + + handleChangeVariablesError(app, errorComponent, e, m); } } else { -- cgit v1.2.3 From aa13b3432bab77bb2dfca0db9b437b222517813f Mon Sep 17 00:00:00 2001 From: Automerge Date: Wed, 15 Feb 2012 02:18:50 +0000 Subject: [merge from 6.7] #8114 - Fixed TabSheet rendering of first tab when another tab is selected svn changeset:23014/svn branch:6.8 --- .../vaadin/terminal/gwt/client/ui/VTabsheet.java | 7 ++- .../tabsheet/TabSheetSelectionStyles.html | 67 ++++++++++++++++++++++ 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html (limited to 'src') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java index d30d999d16..39b3779682 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTabsheet.java @@ -52,7 +52,7 @@ public class VTabsheet extends VTabsheetBase { /** * Representation of a single "tab" shown in the TabBar - * + * */ private static class Tab extends SimplePanel { private static final String TD_CLASSNAME = CLASSNAME + "-tabitemcell"; @@ -341,13 +341,16 @@ public class VTabsheet extends VTabsheetBase { } public Tab addTab() { + // Must check this before insert as insert updates the tab count + boolean firstTab = (getTabCount() == 0); + Tab t = new Tab(this); // Logical attach int spacerIndex = getTabCount(); insert(t, tr, spacerIndex, true); - if (getTabCount() == 0) { + if (firstTab) { // Set the "first" style t.setStyleNames(false, true); } diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html new file mode 100644 index 0000000000..e046cfacb4 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetSelectionStyles.html @@ -0,0 +1,67 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/TabSheetIndexOperations?restartApplication
screenCapturetab1-selected
mouseClickvaadin=runTabSheetIndexOperations::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]21,8
screenCapturetab2-selected
open/run/TabSheetIndexOperations
screenCapturetab2-selected
mouseClickvaadin=runTabSheetIndexOperations::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]14,5
screenCapturetab1-selected
open/run/TabSheetIndexOperations
screenCapturetab1-selected
+ + -- cgit v1.2.3