From 41e56e93ce3d03cec7b904cbd3e2d7ea2f7597da Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 28 Aug 2012 15:56:20 +0000 Subject: Test using Firefox 15 (#9425) svn changeset:24236/svn branch:6.8 --- tests/test.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.xml b/tests/test.xml index 76932bd75f..00de139016 100644 --- a/tests/test.xml +++ b/tests/test.xml @@ -5,7 +5,7 @@ - + -- cgit v1.2.3 From a17dd65572efed55f475a83871de112d978ed99f Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Wed, 29 Aug 2012 13:10:02 +0000 Subject: Refactor discard() contents into a private helper so that overridden versions are not unexpectedly called in attach() (#9181) svn changeset:24245/svn branch:6.8 --- src/com/vaadin/ui/AbstractField.java | 91 +++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index e1d3270225..a3f46cd39a 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -301,47 +301,7 @@ public abstract class AbstractField extends AbstractComponent implements Field, * we use the default documentation from the implemented interface. */ public void discard() throws Buffered.SourceException { - if (dataSource != null) { - - // Gets the correct value from datasource - Object newValue; - try { - - // Discards buffer by overwriting from datasource - newValue = String.class == getType() ? dataSource.toString() - : dataSource.getValue(); - - // If successful, remove set the buffering state to be ok - if (currentBufferedSourceException != null) { - currentBufferedSourceException = null; - requestRepaint(); - } - } catch (final Throwable e) { - - // Sets the buffering state - currentBufferedSourceException = new Buffered.SourceException( - this, e); - requestRepaint(); - - // Throws the source exception - throw currentBufferedSourceException; - } - - final boolean wasModified = isModified(); - modified = false; - - // If the new value differs from the previous one - if ((newValue == null && value != null) - || (newValue != null && !newValue.equals(value))) { - setInternalValue(newValue); - fireValueChange(false); - } - - // If the value did not change, but the modification status did - else if (wasModified) { - requestRepaint(); - } - } + updateValueFromDataSource(); } /* @@ -1140,8 +1100,9 @@ public abstract class AbstractField extends AbstractComponent implements Field, if (!isListeningToPropertyEvents) { addPropertyListeners(); if (!isModified() && isReadThrough()) { - // Update value from data source - discard(); + // The property value may have changed while the field was + // detached and not listening + updateValueFromDataSource(); } } } @@ -1356,6 +1317,50 @@ public abstract class AbstractField extends AbstractComponent implements Field, } } + private void updateValueFromDataSource() { + if (dataSource != null) { + + // Gets the correct value from datasource + Object newValue; + try { + + // Discards buffer by overwriting from datasource + newValue = String.class == getType() ? dataSource.toString() + : dataSource.getValue(); + + // If successful, remove set the buffering state to be ok + if (currentBufferedSourceException != null) { + currentBufferedSourceException = null; + requestRepaint(); + } + } catch (final Throwable e) { + + // Sets the buffering state + currentBufferedSourceException = new Buffered.SourceException( + this, e); + requestRepaint(); + + // Throws the source exception + throw currentBufferedSourceException; + } + + final boolean wasModified = isModified(); + modified = false; + + // If the new value differs from the previous one + if ((newValue == null && value != null) + || (newValue != null && !newValue.equals(value))) { + setInternalValue(newValue); + fireValueChange(false); + } + + // If the value did not change, but the modification status did + else if (wasModified) { + requestRepaint(); + } + } + } + /** * Registers this as an event listener for events sent by the data source * (if any). Does nothing if -- cgit v1.2.3 From 0b715b453186e492e0c20c4964a28706a76ef9e7 Mon Sep 17 00:00:00 2001 From: John Alhroos Date: Thu, 30 Aug 2012 06:50:46 +0000 Subject: Updated version check url svn changeset:24249/svn branch:6.8 --- src/com/vaadin/tools/WidgetsetCompiler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/vaadin/tools/WidgetsetCompiler.java b/src/com/vaadin/tools/WidgetsetCompiler.java index 9bb76022ae..ae9efa67ae 100644 --- a/src/com/vaadin/tools/WidgetsetCompiler.java +++ b/src/com/vaadin/tools/WidgetsetCompiler.java @@ -63,6 +63,8 @@ public class WidgetsetCompiler { System.out.println("Starting GWT compiler"); System.setProperty("gwt.nowarn.legacy.tools", "true"); + System.setProperty("gwt.forceVersionCheckURL", + "http://tools.vaadin.com/version/currentversion.xml"); Class compilerClass = Class .forName("com.google.gwt.dev.GWTCompiler"); Method method = compilerClass.getDeclaredMethod("main", -- cgit v1.2.3 From c75cf3956abddcf71ec72e0743eae1cdd52aa661 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 3 Sep 2012 12:31:35 +0000 Subject: TestBench test case for #8291 svn changeset:24289/svn branch:6.8 --- .../components/table/TableReduceContainerSize.html | 67 ++++++++++ .../components/table/TableReduceContainerSize.java | 147 +++++++++++++++++++++ .../com/vaadin/tests/tickets/Ticket8291.java | 121 ----------------- 3 files changed, 214 insertions(+), 121 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.html create mode 100644 tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.java delete mode 100644 tests/testbench/com/vaadin/tests/tickets/Ticket8291.java diff --git a/tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.html b/tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.html new file mode 100644 index 0000000000..9bd0149bdb --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.html @@ -0,0 +1,67 @@ + + + + + + +TableReduceContainerSize + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TableReduceContainerSize
open/run/TableReduceContainerSize?restartApplication
scrollvaadin=runTableReduceContainerSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]19700
pause300
clickvaadin=runTableReduceContainerSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]
assertTextvaadin=runTableReduceContainerSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VLabel[0]Index: *
clickvaadin=runTableReduceContainerSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]
scrollvaadin=runTableReduceContainerSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]19700
pause300
clickvaadin=runTableReduceContainerSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]
assertTextvaadin=runTableReduceContainerSize::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VLabel[0]Index: *
+ + diff --git a/tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.java b/tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.java new file mode 100644 index 0000000000..bc729ef042 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/table/TableReduceContainerSize.java @@ -0,0 +1,147 @@ +package com.vaadin.tests.components.table; + +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.tests.components.TestBase; +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.Table; + +/** + * Test for #8291 and #7666: NegativeArraySizeException when Table scrolled to + * the end and its size reduced. + */ +public class TableReduceContainerSize extends TestBase { + + @Override + protected void setup() { + addComponent(new TestView()); + } + + private static class DecimateFilter implements Filter { + public boolean passesFilter(Object itemId, Item item) + throws UnsupportedOperationException { + return ((((TestObject) itemId).property3 % 10) == 0); + } + + 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 data = createData(1000); + final BeanItemContainer container = new BeanItemContainer( + TestObject.class, data) { + + @Override + public int size() { + if (reduceData) { + return 100; + } else { + return super.size(); + } + } + }; + table.setContainerDataSource(container); + addComponent(table); + final Label label = new Label(); + addComponent(label); + Button button = new Button("Click"); + button.addListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + try { + reduceData = !reduceData; + table.refreshRowCache(); + label.setValue("Index: " + + table.getCurrentPageFirstItemIndex()); + } catch (Exception e) { + label.setValue("Exception: " + + e.getClass().getSimpleName()); + } + } + }); + addComponent(button); + Button button2 = new Button("Filter"); + button2.addListener(new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + try { + if (filter != null) { + container.removeAllContainerFilters(); + filter = null; + } else { + filter = new DecimateFilter(); + container.addContainerFilter(filter); + } + table.refreshRowCache(); + label.setValue("Index: " + + table.getCurrentPageFirstItemIndex()); + } catch (Exception e) { + label.setValue("Exception: " + + e.getClass().getSimpleName()); + } + } + }); + addComponent(button2); + } + } + + private static List createData(int count) { + ArrayList data = new ArrayList(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; + } + + } + + @Override + protected String getDescription() { + return "Table throws NegativeArraySizeException if container size is reduced to less than current scroll position"; + } + + @Override + protected Integer getTicketNumber() { + return 8291; + } + +} diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java b/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java deleted file mode 100644 index 86b5db953b..0000000000 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import com.vaadin.Application; -import com.vaadin.data.Container.Filter; -import com.vaadin.data.Item; -import com.vaadin.data.util.BeanItemContainer; -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.Window; - -/** - * Test for #8291 and #7666: NegativeArraySizeException when Table scrolled to - * the end and its size reduced. - */ -public class Ticket8291 extends Application { - - @Override - public void init() { - setMainWindow(new Window("", new TestView())); - } - - private static class DecimateFilter implements Filter { - public boolean passesFilter(Object itemId, Item item) - throws UnsupportedOperationException { - return ((((TestObject) itemId).property3 % 10) == 0); - } - - 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 data = createData(1000); - final BeanItemContainer container = new BeanItemContainer( - 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() { - public void buttonClick(ClickEvent event) { - reduceData = !reduceData; - table.refreshRowCache(); - } - }); - addComponent(button); - Button button2 = new Button("Filter"); - button2.addListener(new Button.ClickListener() { - 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 createData(int count) { - ArrayList data = new ArrayList(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; - } - - } - -} -- cgit v1.2.3 From ffb36a03ad29fc947fd65e50eda75fcba5a88517 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 3 Sep 2012 15:13:11 +0000 Subject: Make clicking off-month days work correctly with an InlineDateField (#8931) svn changeset:24290/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java index 845ac837f6..fc73443bb9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java @@ -118,8 +118,15 @@ public class VCalendarPanel extends FocusableFlexTable implements * .event.dom.client.ClickEvent) */ public void onClick(ClickEvent event) { - Day day = (Day) event.getSource(); - focusDay(day.getDate()); + Date newDate = ((Day) event.getSource()).getDate(); + if (newDate.getMonth() != displayedMonth.getMonth()) { + // If an off-month date was clicked, we must change the + // displayed month and re-render the calendar (#8931) + displayedMonth.setMonth(newDate.getMonth()); + displayedMonth.setYear(newDate.getYear()); + renderCalendar(); + } + focusDay(newDate); selectFocused(); onSubmit(); } @@ -386,8 +393,8 @@ public class VCalendarPanel extends FocusableFlexTable implements } final String monthName = needsMonth ? getDateTimeService().getMonth( - focusedDate.getMonth()) : ""; - final int year = focusedDate.getYear() + 1900; + displayedMonth.getMonth()) : ""; + final int year = displayedMonth.getYear() + 1900; getFlexCellFormatter().setStyleName(0, 2, VDateField.CLASSNAME + "-calendarpanel-month"); setHTML(0, 2, " Date: Tue, 4 Sep 2012 08:18:53 +0000 Subject: Avoid fragment change events when the fragment has not changed (#8916) svn changeset:24298/svn branch:6.8 --- .../gwt/client/ui/VUriFragmentUtility.java | 6 ++ .../urifragmentutilty/FragmentChangeLoop.html | 97 ++++++++++++++++++++++ .../urifragmentutilty/FragmentChangeLoop.java | 72 ++++++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.html create mode 100644 tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java diff --git a/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java b/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java index db01699383..209cb6913c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VUriFragmentUtility.java @@ -76,7 +76,13 @@ public class VUriFragmentUtility extends Widget implements Paintable, public void onValueChange(ValueChangeEvent event) { String historyToken = event.getValue(); + if (fragment != null && fragment.equals(historyToken)) { + // Do nothing if the fragment has not changed. This can at least + // happen when detaching and attaching a UriFragmentUtility. + return; + } fragment = historyToken; + if (client != null) { client.updateVariable(paintableId, "fragment", fragment, immediate); } diff --git a/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.html b/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.html new file mode 100644 index 0000000000..7e67f72a7f --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.html @@ -0,0 +1,97 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.urifragmentutilty.FragmentChangeLoop?restartApplication
assertText//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[2]/div/div0 fragment events
click//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[3]/div/div/span/span
assertLocationhttp://*/run/com.vaadin.tests.components.urifragmentutilty.FragmentChangeLoop?restartApplication#F
assertText//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[2]/div/div1 fragment events
click//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[4]/div/div/span/span
assertLocationhttp://*/run/com.vaadin.tests.components.urifragmentutilty.FragmentChangeLoop?restartApplication#F1
assertText//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[2]/div/div2 fragment events
click//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[4]/div/div/span/span
assertLocationhttp://*/run/com.vaadin.tests.components.urifragmentutilty.FragmentChangeLoop?restartApplication#F11
assertText//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[2]/div/div3 fragment events
click//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[3]/div/div/span/span
assertLocationhttp://*/run/com.vaadin.tests.components.urifragmentutilty.FragmentChangeLoop?restartApplication#F
assertText//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[2]/div/div4 fragment events
click//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[3]/div/div/span/span
assertText//div[@id='runcomvaadintestscomponentsurifragmentutiltyFragmentChangeLoop-95852473']/div/div[2]/div/div[2]/div/div/div/div[2]/div/div4 fragment events
+ + diff --git a/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java b/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java new file mode 100644 index 0000000000..ecd3461d3c --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java @@ -0,0 +1,72 @@ +package com.vaadin.tests.components.urifragmentutilty; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.UriFragmentUtility; +import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent; +import com.vaadin.ui.UriFragmentUtility.FragmentChangedListener; +import com.vaadin.ui.VerticalLayout; + +public class FragmentChangeLoop extends TestBase { + VerticalLayout layout1 = new VerticalLayout(); + VerticalLayout layout2 = new VerticalLayout(); + VerticalLayout layoutCurrent = null; + UriFragmentUtility uriFragmentUtility = new UriFragmentUtility(); + Integer i = 0; + private Label status; + private Button setToF; + private Button addOne; + + @Override + protected void setup() { + uriFragmentUtility.addListener(new FragmentChangedListener() { + + public void fragmentChanged(FragmentChangedEvent source) { + status.setValue(++i + " fragment events"); + VerticalLayout layoutNew = (layoutCurrent == layout1 ? layout2 + : layout1); + replaceComponent(layoutCurrent, layoutNew); + layoutCurrent = layoutNew; + + } + }); + + layout1.setCaption("Layout 1"); + layout2.setCaption("Layout 2"); + addComponent(layout1); + layoutCurrent = layout1; + status = new Label("0 fragment events"); + setToF = new Button("Set fragment to F", new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + uriFragmentUtility.setFragment("F"); + } + }); + addOne = new Button("Append '1' to fragment", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + uriFragmentUtility.setFragment(uriFragmentUtility + .getFragment() + "1"); + } + }); + addComponent(status); + addComponent(setToF); + addComponent(addOne); + + addComponent(uriFragmentUtility); + + } + + @Override + protected String getDescription() { + return "Click the button to set the fragment to F. " + + "This should cause the counter on the button to increase by one (unless the fragment is already F in case it should do nothing)."; + } + + @Override + protected Integer getTicketNumber() { + return 8916; + } + +} -- cgit v1.2.3 From 8b1e5a2d314ae89d96f38f2d09517bb2a45705dd Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Tue, 4 Sep 2012 11:14:09 +0000 Subject: Enable (hopefully this time for real) native touch scrolling on Mobile Safari 6+ (#8792) svn changeset:24300/svn branch:6.8 --- WebContent/VAADIN/themes/base/common/common.css | 6 +++++- src/com/vaadin/terminal/gwt/client/BrowserInfo.java | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/WebContent/VAADIN/themes/base/common/common.css b/WebContent/VAADIN/themes/base/common/common.css index 74ed21bd1a..4dbe35704c 100644 --- a/WebContent/VAADIN/themes/base/common/common.css +++ b/WebContent/VAADIN/themes/base/common/common.css @@ -233,4 +233,8 @@ div.v-app-loading { .v-scrollable { overflow: auto; -} \ No newline at end of file +} +/* Enable kinetic scrolling on Mobile Safari 6 */ +.v-ios.v-sa6 .v-scrollable { + -webkit-overflow-scrolling: touch; +} \ No newline at end of file diff --git a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java index 6a94611a60..838af93ed5 100644 --- a/src/com/vaadin/terminal/gwt/client/BrowserInfo.java +++ b/src/com/vaadin/terminal/gwt/client/BrowserInfo.java @@ -447,13 +447,15 @@ public class BrowserInfo { if (!isTouchDevice()) { return false; } + // TODO Should test other Android browsers, especially Chrome if (isAndroid() && isWebkit() && getWebkitVersion() >= 534) { return false; } - // Cannot enable native touch scrolling on iOS 5 until #8792 is resolved - // if (isIOS() && isWebkit() && getWebkitVersion() >= 534) { - // return false; - // } + // iOS 6 Safari supports native scrolling; iOS 5 suffers from #8792 + // TODO Should test other iOS browsers + if (isIOS() && isSafari() && getBrowserMajorVersion() >= 6) { + return false; + } return true; } -- cgit v1.2.3 From 5745d1e805aa6d44dd685769344c8b92b64bcd63 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 4 Sep 2012 11:52:33 +0000 Subject: CRLF -> LF svn changeset:24301/svn branch:6.8 --- .../urifragmentutilty/FragmentChangeLoop.java | 144 ++++++++++----------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java b/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java index ecd3461d3c..ead1669089 100644 --- a/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java +++ b/tests/testbench/com/vaadin/tests/components/urifragmentutilty/FragmentChangeLoop.java @@ -1,72 +1,72 @@ -package com.vaadin.tests.components.urifragmentutilty; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Label; -import com.vaadin.ui.UriFragmentUtility; -import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent; -import com.vaadin.ui.UriFragmentUtility.FragmentChangedListener; -import com.vaadin.ui.VerticalLayout; - -public class FragmentChangeLoop extends TestBase { - VerticalLayout layout1 = new VerticalLayout(); - VerticalLayout layout2 = new VerticalLayout(); - VerticalLayout layoutCurrent = null; - UriFragmentUtility uriFragmentUtility = new UriFragmentUtility(); - Integer i = 0; - private Label status; - private Button setToF; - private Button addOne; - - @Override - protected void setup() { - uriFragmentUtility.addListener(new FragmentChangedListener() { - - public void fragmentChanged(FragmentChangedEvent source) { - status.setValue(++i + " fragment events"); - VerticalLayout layoutNew = (layoutCurrent == layout1 ? layout2 - : layout1); - replaceComponent(layoutCurrent, layoutNew); - layoutCurrent = layoutNew; - - } - }); - - layout1.setCaption("Layout 1"); - layout2.setCaption("Layout 2"); - addComponent(layout1); - layoutCurrent = layout1; - status = new Label("0 fragment events"); - setToF = new Button("Set fragment to F", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - uriFragmentUtility.setFragment("F"); - } - }); - addOne = new Button("Append '1' to fragment", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - uriFragmentUtility.setFragment(uriFragmentUtility - .getFragment() + "1"); - } - }); - addComponent(status); - addComponent(setToF); - addComponent(addOne); - - addComponent(uriFragmentUtility); - - } - - @Override - protected String getDescription() { - return "Click the button to set the fragment to F. " - + "This should cause the counter on the button to increase by one (unless the fragment is already F in case it should do nothing)."; - } - - @Override - protected Integer getTicketNumber() { - return 8916; - } - -} +package com.vaadin.tests.components.urifragmentutilty; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.UriFragmentUtility; +import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent; +import com.vaadin.ui.UriFragmentUtility.FragmentChangedListener; +import com.vaadin.ui.VerticalLayout; + +public class FragmentChangeLoop extends TestBase { + VerticalLayout layout1 = new VerticalLayout(); + VerticalLayout layout2 = new VerticalLayout(); + VerticalLayout layoutCurrent = null; + UriFragmentUtility uriFragmentUtility = new UriFragmentUtility(); + Integer i = 0; + private Label status; + private Button setToF; + private Button addOne; + + @Override + protected void setup() { + uriFragmentUtility.addListener(new FragmentChangedListener() { + + public void fragmentChanged(FragmentChangedEvent source) { + status.setValue(++i + " fragment events"); + VerticalLayout layoutNew = (layoutCurrent == layout1 ? layout2 + : layout1); + replaceComponent(layoutCurrent, layoutNew); + layoutCurrent = layoutNew; + + } + }); + + layout1.setCaption("Layout 1"); + layout2.setCaption("Layout 2"); + addComponent(layout1); + layoutCurrent = layout1; + status = new Label("0 fragment events"); + setToF = new Button("Set fragment to F", new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + uriFragmentUtility.setFragment("F"); + } + }); + addOne = new Button("Append '1' to fragment", + new Button.ClickListener() { + public void buttonClick(ClickEvent event) { + uriFragmentUtility.setFragment(uriFragmentUtility + .getFragment() + "1"); + } + }); + addComponent(status); + addComponent(setToF); + addComponent(addOne); + + addComponent(uriFragmentUtility); + + } + + @Override + protected String getDescription() { + return "Click the button to set the fragment to F. " + + "This should cause the counter on the button to increase by one (unless the fragment is already F in case it should do nothing)."; + } + + @Override + protected Integer getTicketNumber() { + return 8916; + } + +} -- cgit v1.2.3 From 3c3e5f92dc7aa41e70055e3a241b29ea41537521 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Tue, 4 Sep 2012 13:06:15 +0000 Subject: Bugfix: year change when navigating a DateField calendar with arrow keys left the calendar in inconsistent state (#8931) svn changeset:24303/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java index fc73443bb9..b5a4ee2477 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VCalendarPanel.java @@ -119,7 +119,8 @@ public class VCalendarPanel extends FocusableFlexTable implements */ public void onClick(ClickEvent event) { Date newDate = ((Day) event.getSource()).getDate(); - if (newDate.getMonth() != displayedMonth.getMonth()) { + if (newDate.getMonth() != displayedMonth.getMonth() + || newDate.getYear() != displayedMonth.getYear()) { // If an off-month date was clicked, we must change the // displayed month and re-render the calendar (#8931) displayedMonth.setMonth(newDate.getMonth()); @@ -595,14 +596,17 @@ public class VCalendarPanel extends FocusableFlexTable implements */ private void focusNextDay(int days) { int oldMonth = focusedDate.getMonth(); + int oldYear = focusedDate.getYear(); focusedDate.setDate(focusedDate.getDate() + days); - if (focusedDate.getMonth() == oldMonth) { + if (focusedDate.getMonth() == oldMonth + && focusedDate.getYear() == oldYear) { // Month did not change, only move the selection focusDay(focusedDate); } else { // If the month changed we need to re-render the calendar displayedMonth.setMonth(focusedDate.getMonth()); + displayedMonth.setYear(focusedDate.getYear()); renderCalendar(); } } -- cgit v1.2.3 From 1db9f49436033878f807c74213f2209d4052f901 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Tue, 4 Sep 2012 13:08:04 +0000 Subject: DateField extended range: test InlineDateField as well as PopupDateField (#6718, #8931) svn changeset:24304/svn branch:6.8 --- .../datefield/DateFieldExtendedRange.html | 382 +++++++++++++++++++++ .../datefield/DateFieldExtendedRange.java | 79 +++++ .../datefield/PopupDateFieldExtendedRange.html | 136 -------- .../datefield/PopupDateFieldExtendedRange.java | 69 ---- 4 files changed, 461 insertions(+), 205 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.html create mode 100644 tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.java delete mode 100644 tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html delete mode 100644 tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.html b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.html new file mode 100644 index 0000000000..aa6c536af3 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.html @@ -0,0 +1,382 @@ + + + + + + +DateFieldExtendedRange + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DateFieldExtendedRange
open/run/DateFieldExtendedRange?restartApplication
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton8,16
screenCapture2011-01-01
assertText//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span27
assertTextvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]#day376
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton11,11
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton10,12
assertText//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span26
assertTextvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]#day365
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton15,20
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton11,8
assertText//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span27
assertTextvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]#day376
assertText//div[@id='runDateFieldExtendedRange-312092003']/div/div[2]/div/div[2]/div/div/div/div[1]/div/div/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span27
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VDateFieldCalendar[0]/VCalendarPanel[0]#day376
assertText//div[@id='runDateFieldExtendedRange-312092003']/div/div[2]/div/div[2]/div/div/div/div[1]/div/div/div/div/div[4]/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span26
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VDateFieldCalendar[0]/VCalendarPanel[0]#day365
assertText//div[@id='runDateFieldExtendedRange-312092003']/div/div[2]/div/div[2]/div/div/div/div[1]/div/div/div/div/div[6]/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span27
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VDateFieldCalendar[0]/VCalendarPanel[0]#day376
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton11,9
mouseClick//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span12,9
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#field27.12.2010
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton10,15
mouseClick//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span14,7
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#field12/26/10
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton15,10
mouseClick//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span6,11
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]#field27.12.2010
mouseClick//div[@id='runDateFieldExtendedRange-312092003']/div/div[2]/div/div[2]/div/div/div/div[1]/div/div/div/div/div[2]/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span11,7
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VDateFieldCalendar[0]/VCalendarPanel[0]#headerjoulukuu 2010
mouseClick//div[@id='runDateFieldExtendedRange-312092003']/div/div[2]/div/div[2]/div/div/div/div[1]/div/div/div/div/div[4]/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span13,4
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VDateFieldCalendar[0]/VCalendarPanel[0]#headerDecember 2010
mouseClick//div[@id='runDateFieldExtendedRange-312092003']/div/div[2]/div/div[2]/div/div/div/div[1]/div/div/div/div/div[6]/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span11,8
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VDateFieldCalendar[0]/VCalendarPanel[0]#headerjoulukuu 2010
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VDateFieldCalendar[0]/VCalendarPanel[0]#day2713,13
pressSpecialKeyvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VDateFieldCalendar[0]/VCalendarPanel[0]down
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VDateFieldCalendar[0]/VCalendarPanel[0]#headertammikuu 2011
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VDateFieldCalendar[0]/VCalendarPanel[0]#day2612,7
pressSpecialKeyvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VDateFieldCalendar[0]/VCalendarPanel[0]down
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VDateFieldCalendar[0]/VCalendarPanel[0]#headerJanuary 2011
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VDateFieldCalendar[0]/VCalendarPanel[0]#day2714,12
pressSpecialKeyvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VDateFieldCalendar[0]/VCalendarPanel[0]down
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VDateFieldCalendar[0]/VCalendarPanel[0]#headertammikuu 2011
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton14,17
pressSpecialKeyvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]down
pressSpecialKeyvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]enter
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#field3.1.2011
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton9,12
pressSpecialKeyvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]down
pressSpecialKeyvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]enter
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#field1/2/11
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton15,15
pressSpecialKeyvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]down
pressSpecialKeyvaadin=runDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]enter
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]#field3.1.2011
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton10,15
mouseClick//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span12,8
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#field27.12.2010
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton12,15
mouseClick//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span14,9
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]#field12/26/10
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton15,15
mouseClick//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/span8,12
assertValuevaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VPopupCalendar[0]#field27.12.2010
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VDateFieldCalendar[0]/VCalendarPanel[0]#day3718,10
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VDateFieldCalendar[0]/VCalendarPanel[0]#headerhelmikuu 2011
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VDateFieldCalendar[0]/VCalendarPanel[0]#day3615,11
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VDateFieldCalendar[0]/VCalendarPanel[0]#headerFebruary 2011
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VDateFieldCalendar[0]/VCalendarPanel[0]#day3719,13
assertTextvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VDateFieldCalendar[0]/VCalendarPanel[0]#headerhelmikuu 2011
clickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton10,13
screenCapture2010-02-16
+ + diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.java new file mode 100644 index 0000000000..e420278148 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldExtendedRange.java @@ -0,0 +1,79 @@ +package com.vaadin.tests.components.datefield; + +import java.util.Calendar; +import java.util.Locale; + +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.DateField; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.InlineDateField; +import com.vaadin.ui.PopupDateField; + +@SuppressWarnings("serial") +public class DateFieldExtendedRange extends TestBase { + + private Calendar date = Calendar.getInstance(); + + @Override + protected void setup() { + date.set(2011, 0, 1); + + GridLayout layout = new GridLayout(2, 3); + layout.setWidth("600px"); + layout.setSpacing(true); + + final DateField[] fields = new DateField[6]; + + Locale fi = new Locale("fi", "FI"); + Locale us = new Locale("en", "US"); + + fields[0] = makeDateField(true, fi, "Finnish locale"); + fields[1] = makeDateField(false, fi, "Finnish locale"); + + fields[2] = makeDateField(true, us, "US English locale"); + fields[3] = makeDateField(false, us, "US English locale"); + + fields[4] = makeDateField(true, fi, "Finnish locale with week numbers"); + fields[4].setShowISOWeekNumbers(true); + fields[5] = makeDateField(false, fi, "Finnish locale with week numbers"); + fields[5].setShowISOWeekNumbers(true); + + for (DateField f : fields) { + layout.addComponent(f); + } + + addComponent(layout); + + addComponent(new Button("Change date", new ClickListener() { + public void buttonClick(ClickEvent event) { + date.set(2010, 1, 16); + for (DateField f : fields) { + f.setValue(date.getTime()); + } + } + })); + } + + @Override + protected String getDescription() { + return "Show a few days of the preceding and following months in the datefield popup"; + } + + @Override + protected Integer getTicketNumber() { + return 6718; + } + + private DateField makeDateField(boolean isPopup, Locale locale, + String caption) { + DateField df = isPopup ? new PopupDateField() : new InlineDateField(); + df.setResolution(DateField.RESOLUTION_DAY); + df.setValue(date.getTime()); + df.setLocale(locale); + df.setCaption(caption); + return df; + } +} diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html deleted file mode 100644 index 2783ed2aa3..0000000000 --- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - -PopupDateFieldExtendedRange - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PopupDateFieldExtendedRange
open/run/com.vaadin.tests.components.datefield.PopupDateFieldExtendedRange?restartApplication
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton7,16
screenCapturepopup1-01-2011
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]#prevmon8,7
screenCapturepopup1-12-2010
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]#prevy12,6
screenCapturepopup1-12-2009
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]#popupButton10,13
clickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupCalendar[0]#popupButton14,13
screenCapturepopup2-02-2010
pressSpecialKeyvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]down
pressSpecialKeyvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]down
screenCapturepopup2-03-2010
pressSpecialKeyvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]left
pressSpecialKeyvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]left
screenCapturepopup2-02-2010-again
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupCalendar[0]#popupButton7,16
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton17,10
pressSpecialKeyvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]shift left
screenCapturepopup3-01-2010
pressSpecialKeyvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::Root/VOverlay[0]/VCalendarPanel[0]shift down
screenCapturepopup3-01-2009
mouseClickvaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldExtendedRange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#popupButton10,8
- - diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java deleted file mode 100644 index 357c61f4f6..0000000000 --- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.vaadin.tests.components.datefield; - -import java.util.Calendar; -import java.util.Locale; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.DateField; -import com.vaadin.ui.PopupDateField; - -@SuppressWarnings("serial") -public class PopupDateFieldExtendedRange extends TestBase { - - private Calendar date = Calendar.getInstance(); - - @Override - protected void setup() { - date.set(2011, 0, 1); - - getLayout().setSpacing(true); - - final PopupDateField[] fields = new PopupDateField[3]; - - fields[0] = makeDateField(); - fields[0].setLocale(new Locale("fi", "FI")); - fields[0].setCaption("Finnish locale"); - - fields[1] = makeDateField(); - fields[1].setLocale(new Locale("en", "US")); - fields[1].setCaption("US English locale"); - - fields[2] = makeDateField(); - fields[2].setLocale(new Locale("fi", "FI")); - fields[2].setShowISOWeekNumbers(true); - fields[2].setCaption("Finnish locale with week numbers"); - - for (PopupDateField f : fields) { - addComponent(f); - } - - addComponent(new Button("Change date", new ClickListener() { - public void buttonClick(ClickEvent event) { - date.set(2010, 1, 16); - for (PopupDateField f : fields) { - f.setValue(date.getTime()); - } - } - })); - } - - @Override - protected String getDescription() { - return "Show a few days of the preceding and following months in the datefield popup"; - } - - @Override - protected Integer getTicketNumber() { - return 6718; - } - - private PopupDateField makeDateField() { - PopupDateField pdf = new PopupDateField(); - pdf.setResolution(DateField.RESOLUTION_DAY); - pdf.setValue(date.getTime()); - return pdf; - } -} -- cgit v1.2.3 From b4e243c87d4b4f28fa18affecb855b8731682a59 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Tue, 4 Sep 2012 13:19:39 +0000 Subject: Tell IE10 to emulate IE9 until IE10 is properly supported (#9462, #9214) svn changeset:24306/svn branch:6.8 --- .../vaadin/terminal/gwt/server/AbstractApplicationServlet.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 9313e3bcad..024ab7f637 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -2079,9 +2079,16 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements WebBrowser browser = getApplicationContext(request.getSession()) .getBrowser(); if (browser.isIE()) { + String content = "chrome=1"; + if (browser.getBrowserMajorVersion() == 10) { + // Tell IE10 to emulate IE9 until IE10 is properly supported + // (#9462, #9214) + content = "IE=9; " + content; + } // Chrome frame in all versions of IE (only if Chrome frame is // installed) - page.write("\n"); + page.write("\n"); } page.write("