From: Henri Sara Date: Wed, 27 Jul 2011 08:15:35 +0000 (+0000) Subject: Merged changes to 6.7 X-Git-Tag: 6.7.0.beta1~169 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ca96dca574f2412c760b0b70a72b3166e9f813fc;p=vaadin-framework.git Merged changes to 6.7 svn changeset:19972/svn branch:6.7 --- diff --git a/WebContent/VAADIN/themes/reindeer/table/table.css b/WebContent/VAADIN/themes/reindeer/table/table.css index 8ac40ba116..156c1c3e50 100644 --- a/WebContent/VAADIN/themes/reindeer/table/table.css +++ b/WebContent/VAADIN/themes/reindeer/table/table.css @@ -24,6 +24,19 @@ line-height: normal; } +.v-ie6 .v-table-header-wrap, +.v-ie6 .v-table-footer-wrap, +.v-ie6 .v-table-column-selector{ + /* Fixes IE6 overflow bug #7314 which causes Table headers to overflow and cover the column selector. */ + position:relative; +} + +.v-ie6 .v-table.v-disabled, +.v-ie7 .v-table.v-disabled{ + /* Fixes ie issue #7324 where disabled shim does not cover table body */ + position:relative; +} + .v-table-footer-wrap, .white .v-table-footer-wrap { text-transform: none; @@ -40,6 +53,7 @@ padding-right: 7px; } + .v-table-header, .v-table-footer, .v-table-footer table { diff --git a/WebContent/VAADIN/themes/sampler/icons/sampleicons/75-MenuBarCheckableItems.gif b/WebContent/VAADIN/themes/sampler/icons/sampleicons/75-MenuBarCheckableItems.gif new file mode 100644 index 0000000000..f59714cc62 Binary files /dev/null and b/WebContent/VAADIN/themes/sampler/icons/sampleicons/75-MenuBarCheckableItems.gif differ diff --git a/build/build.xml b/build/build.xml index d6bdfa6dd1..3197f15c56 100644 --- a/build/build.xml +++ b/build/build.xml @@ -30,16 +30,20 @@ + + + + - + - + @@ -626,7 +630,9 @@ Removing widgetset temp files - + + + @@ -993,7 +999,7 @@ - + @@ -1011,7 +1017,7 @@ - + @@ -1245,6 +1251,8 @@ + + @@ -1257,9 +1265,8 @@ - - - + + @@ -1268,6 +1275,8 @@ + + diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 4b6194b79b..6787b36022 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -223,7 +223,6 @@ public class ApplicationConfiguration implements EntryPoint { } } - deferredWidgetLoadLoop.scheduleRepeating(100); } /** @@ -257,6 +256,7 @@ public class ApplicationConfiguration implements EntryPoint { runningApplications.add(a); return true; } else { + deferredWidgetLoader = new DeferredWidgetLoader(); return false; } } @@ -361,6 +361,8 @@ public class ApplicationConfiguration implements EntryPoint { cmd.execute(); } callbacks.clear(); + } else if(widgetsLoading == 0 && deferredWidgetLoader != null) { + deferredWidgetLoader.trigger(); } } @@ -368,22 +370,44 @@ public class ApplicationConfiguration implements EntryPoint { /* * This loop loads widget implementation that should be loaded deferred. */ - private static final Timer deferredWidgetLoadLoop = new Timer() { + static class DeferredWidgetLoader extends Timer { private static final int FREE_LIMIT = 4; + private static final int FREE_CHECK_TIMEOUT = 100; int communicationFree = 0; int nextWidgetIndex = 0; + private boolean pending; + + public DeferredWidgetLoader() { + schedule(5000); + } + + public void trigger() { + if(!pending) { + schedule(FREE_CHECK_TIMEOUT); + } + } + + @Override + public void schedule(int delayMillis) { + super.schedule(delayMillis); + pending = true; + } @Override public void run() { + pending = false; if (!isBusy()) { Class nextType = getNextType(); if (nextType == null) { // ensured that all widgets are loaded - cancel(); + deferredWidgetLoader = null; } else { + communicationFree = 0; widgetSet.loadImplementation(nextType); } + } else { + schedule(FREE_CHECK_TIMEOUT); } } @@ -400,21 +424,23 @@ public class ApplicationConfiguration implements EntryPoint { private boolean isBusy() { if (widgetsLoading > 0) { communicationFree = 0; - return false; + return true; } for (ApplicationConnection app : runningApplications) { if (app.hasActiveRequest()) { // if an UIDL request or widget loading is active, mark as // busy communicationFree = 0; - return false; + return true; } } communicationFree++; return communicationFree < FREE_LIMIT; } - }; - + } + + private static DeferredWidgetLoader deferredWidgetLoader; + public void onModuleLoad() { // Enable IE6 Background image caching diff --git a/src/com/vaadin/terminal/gwt/client/CSSRule.java b/src/com/vaadin/terminal/gwt/client/CSSRule.java index 5c7758e0dd..97604d242e 100644 --- a/src/com/vaadin/terminal/gwt/client/CSSRule.java +++ b/src/com/vaadin/terminal/gwt/client/CSSRule.java @@ -72,7 +72,7 @@ public class CSSRule { var j = theRules.length; for(var i=0; i 4) { - doSend.execute(); - } else { - sendToRemoteLog.trigger(); - } + sendToRemoteLog.trigger(); } /** diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 1226c5ae79..8f8958d365 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -807,6 +807,18 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, enabled = !uidl.hasAttribute("disabled"); + if (BrowserInfo.get().isIE8() && !enabled) { + /* + * The disabled shim will not cover the table body if it is + * relative in IE8. See #7324 + */ + scrollBodyPanel.getElement().getStyle() + .setPosition(Position.STATIC); + } else if (BrowserInfo.get().isIE8()) { + scrollBodyPanel.getElement().getStyle() + .setPosition(Position.RELATIVE); + } + this.client = client; paintableId = uidl.getStringAttribute("id"); immediate = uidl.getBooleanAttribute("immediate"); diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java index ef08e81e10..eb8a2e63c5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java @@ -511,9 +511,27 @@ public class VTree extends FocusElementPanel implements Paintable, * Sends the selection to the server */ private void sendSelectionToServer() { - client.updateVariable(paintableId, "selected", selectedIds - .toArray(new String[selectedIds.size()]), immediate); - selectionHasChanged = false; + Command command = new Command() { + public void execute() { + client.updateVariable(paintableId, "selected", + selectedIds.toArray(new String[selectedIds.size()]), + immediate); + selectionHasChanged = false; + } + }; + + /* + * Delaying the sending of the selection in webkit to ensure the + * selection is always sent when the tree has focus and after click + * events have been processed. This is due to the focusing + * implementation in FocusImplSafari which uses timeouts when focusing + * and blurring. + */ + if (BrowserInfo.get().isWebkit()) { + Scheduler.get().scheduleDeferred(command); + } else { + command.execute(); + } } /** diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java b/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java index a3f1c59846..7ad790e25e 100644 --- a/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java +++ b/src/com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.TreeSet; @@ -244,10 +245,16 @@ public class WidgetMapGenerator extends Generator { boolean first = true; ArrayList> lazyLoadedWidgets = new ArrayList>(); + + HashSet> widgetsWithInstantiator = new HashSet>(); + for (Class class1 : paintablesHavingWidgetAnnotation) { ClientWidget annotation = class1.getAnnotation(ClientWidget.class); Class clientClass = annotation .value(); + if(widgetsWithInstantiator.contains(clientClass)) { + continue; + } if (clientClass == VView.class) { // VView's are not instantiated by widgetset continue; @@ -288,6 +295,7 @@ public class WidgetMapGenerator extends Generator { sourceWriter.print(");"); } sourceWriter.print("}"); + widgetsWithInstantiator.add(clientClass); } sourceWriter.println("}"); diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index 622b8d18d9..4ed76d367b 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -1,4 +1,4 @@ -/* +/* @ITMillApache2LicenseForJavaFiles@ */ @@ -123,20 +123,7 @@ public abstract class AbstractTextField extends AbstractField implements throw new IllegalStateException( "Null values are not allowed if the null-representation is null"); } - - if (requestRepaintInTextChangeEvent && !valueChangeInTextChangeEvent) { - /* - * If the repaint occurred in a text change event then we do not - * want to send back the old value since it will just overwrite the - * typed value so we send the last known value instead which is - * updated by the text change event. - */ - target.addVariable(this, "text", lastKnownTextContent); - } else { - target.addVariable(this, "text", value); - } - requestRepaintInTextChangeEvent = false; - valueChangeInTextChangeEvent = false; + target.addVariable(this, "text", value); if (selectionPosition != -1) { target.addAttribute("selpos", selectionPosition); @@ -184,22 +171,6 @@ public abstract class AbstractTextField extends AbstractField implements } } - /** - * Flag for monitoring if a repaint gets requested in a text change event - */ - private boolean requestRepaintInTextChangeEvent = false; - - @Override - public void requestRepaint() { - if (textChangeEventPending) { - /* - * Textchange event listener triggered this repaint - */ - requestRepaintInTextChangeEvent = true; - } - super.requestRepaint(); - } - @Override public void changeVariables(Object source, Map variables) { changingVariables = true; @@ -467,26 +438,13 @@ public abstract class AbstractTextField extends AbstractField implements private void firePendingTextChangeEvent() { if (textChangeEventPending) { - fireEvent(new TextChangeEventImpl(this)); textChangeEventPending = false; + fireEvent(new TextChangeEventImpl(this)); } } - /** - * Flag for monitoring if the value got changed in a TextChangeEvent - * listener - */ - protected boolean valueChangeInTextChangeEvent = false; - @Override protected void setInternalValue(Object newValue) { - if (textChangeEventPending) { - /* - * Value changed in a TextChangeEvent listener - */ - valueChangeInTextChangeEvent = true; - } - if (changingVariables && !textChangeEventPending) { /* * Fire a "simulated" text change event before value change event if diff --git a/tests/integration_tests.xml b/tests/integration_tests.xml index 9caea35270..b183a317a3 100644 --- a/tests/integration_tests.xml +++ b/tests/integration_tests.xml @@ -53,6 +53,7 @@ + diff --git a/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html b/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html new file mode 100644 index 0000000000..8795ad12dc --- /dev/null +++ b/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.html @@ -0,0 +1,32 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.formlayout.TableInFormLayoutCausesScrolling?restartApplication
mouseClickvaadin=runcomvaadintestscomponentsformlayoutTableInFormLayoutCausesScrolling::/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]12,13
screenCaptureshould-be-scrolled-up
+ + diff --git a/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java new file mode 100644 index 0000000000..157772f8cd --- /dev/null +++ b/tests/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java @@ -0,0 +1,45 @@ +package com.vaadin.tests.components.formlayout; + +import com.vaadin.tests.components.AbstractTestCase; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.Table; +import com.vaadin.ui.TextField; +import com.vaadin.ui.Window; + +public class TableInFormLayoutCausesScrolling extends AbstractTestCase { + + @Override + public void init() { + // Window Initialization. + final Window window = new Window("Main Window"); + setMainWindow(window); + + // FormLayout creation + final FormLayout fl = new FormLayout(); + window.setContent(fl); + + // Add 20 TextField + for (int i = 20; i-- > 0;) { + fl.addComponent(new TextField()); + } + + // Add 1 selectable table with some items + final Table table = new Table(); + table.setSelectable(true); + table.addContainerProperty("item", String.class, ""); + for (int i = 50; i-- > 0;) { + table.addItem(new String[] { "item" + i }, i); + } + window.addComponent(table); + } + + @Override + protected String getDescription() { + return "Clicking in the Table should not cause the page to scroll"; + } + + @Override + protected Integer getTicketNumber() { + return 7309; + } +} \ No newline at end of file diff --git a/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.html b/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.html new file mode 100644 index 0000000000..f0d837d97a --- /dev/null +++ b/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.html @@ -0,0 +1,36 @@ + + + + + + +New Test + + + + + + + + + + + + + + + + + + + + + + + + + + +
New Test
open/run/com.vaadin.tests.components.orderedlayout.VerticalLayoutWidthCalculation?restartApplication
clickvaadin=runcomvaadintestscomponentsorderedlayoutVerticalLayoutWidthCalculation::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
clickvaadin=runcomvaadintestscomponentsorderedlayoutVerticalLayoutWidthCalculation::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]
screenCapturewindow-sized-to-one-textfield
+ + diff --git a/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java b/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java new file mode 100644 index 0000000000..f59b940353 --- /dev/null +++ b/tests/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java @@ -0,0 +1,63 @@ +package com.vaadin.tests.components.orderedlayout; + +import com.vaadin.tests.components.AbstractTestCase; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; + +public class VerticalLayoutWidthCalculation extends AbstractTestCase { + @Override + public void init() { + final Window mainWindow = new Window("Vaadintest Application"); + mainWindow.addWindow(createSubWindow()); + setMainWindow(mainWindow); + + } + + private Window createSubWindow() { + HorizontalLayout hl = new HorizontalLayout(); + + VerticalLayout vlTF1 = new VerticalLayout(); + vlTF1.setSizeUndefined(); + final TextField tf1 = new TextField("Text1"); + tf1.setSizeUndefined(); + vlTF1.addComponent(tf1); + hl.addComponent(vlTF1); + + VerticalLayout vlTF2 = new VerticalLayout(); + vlTF2.setSizeUndefined(); + final TextField tf2 = new TextField("Text2"); + tf2.setVisible(false); + tf2.setSizeUndefined(); + vlTF2.addComponent(tf2); + hl.addComponent(vlTF2); + + Window wnd = new Window("Test"); + wnd.getContent().setSizeUndefined(); + wnd.addComponent(hl); + Button btn = new Button("Show/hide"); + btn.addListener(new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + tf2.setVisible(!tf2.isVisible()); + } + }); + wnd.addComponent(btn); + + return wnd; + } + + @Override + protected String getDescription() { + return "The second TextField is initially invisible. Make it visible and then hide it again. You should end up with the same result as initially."; + } + + @Override + protected Integer getTicketNumber() { + return 7260; + } + +} diff --git a/tests/test.xml b/tests/test.xml index 512db895a9..7f6331ec8e 100644 --- a/tests/test.xml +++ b/tests/test.xml @@ -5,11 +5,14 @@ - + + + + @@ -20,6 +23,9 @@ + + + @@ -43,16 +49,12 @@
- - - - - + @@ -62,30 +64,8 @@ - - - - - - - - - - - - - - - - - - - - - - - + @@ -183,6 +163,9 @@ + + +