aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2010-01-28 17:46:50 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2010-01-28 17:46:50 +0000
commit810017204ef10e2d5fbea15ed17b0c1e8a6b0daa (patch)
tree86dd95e68bddc78016f5eeab6687554ea79563a7
parent1e2a4afc96a7376b922b342224f8e2e4297385aa (diff)
downloadvaadin-framework-810017204ef10e2d5fbea15ed17b0c1e8a6b0daa.tar.gz
vaadin-framework-810017204ef10e2d5fbea15ed17b0c1e8a6b0daa.zip
some preliminary drag and drop stuff
svn changeset:11052/svn branch:6.3_dd
-rw-r--r--WebContent/VAADIN/readme.txt3
-rw-r--r--WebContent/VAADIN/themes/base/button/button.css6
-rw-r--r--WebContent/VAADIN/themes/base/styles.css6
-rw-r--r--WebContent/VAADIN/themes/reindeer/button/button-link-style.css5
-rw-r--r--WebContent/VAADIN/themes/reindeer/styles.css15
-rw-r--r--WebContent/VAADIN/themes/runo/styles.css6
-rw-r--r--WebContent/WEB-INF/web.xml2
-rw-r--r--WebContent/index.html2
-rw-r--r--WebContent/multiapp.html2
-rw-r--r--WebContent/release-notes.html239
-rw-r--r--src/com/vaadin/data/util/ContainerHierarchicalWrapper.java23
-rw-r--r--src/com/vaadin/data/util/HierarchicalContainer.java26
-rw-r--r--src/com/vaadin/data/util/IndexedContainer.java3
-rw-r--r--src/com/vaadin/launcher/DevelopmentServerLauncher.java4
-rw-r--r--src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml12
-rwxr-xr-xsrc/com/vaadin/terminal/gwt/client/ApplicationConnection.java9
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java9
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java55
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java37
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VTree.java238
-rw-r--r--src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java33
-rw-r--r--src/com/vaadin/ui/AbsoluteLayout.java1
-rw-r--r--src/com/vaadin/ui/CustomLayout.java56
-rw-r--r--src/com/vaadin/ui/Select.java6
-rw-r--r--src/com/vaadin/ui/Table.java76
-rw-r--r--src/com/vaadin/ui/Tree.java89
-rw-r--r--tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html5
-rw-r--r--tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html5
-rw-r--r--tests/src/com/vaadin/tests/layouts/GridLayoutNPE.java72
-rw-r--r--tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.html402
-rw-r--r--tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java136
31 files changed, 714 insertions, 869 deletions
diff --git a/WebContent/VAADIN/readme.txt b/WebContent/VAADIN/readme.txt
index 672862a35c..926bc01a9e 100644
--- a/WebContent/VAADIN/readme.txt
+++ b/WebContent/VAADIN/readme.txt
@@ -29,7 +29,8 @@ Vaadin Development
When developing the Vaadin Library itself, change to "build" directory and
run "ant widgetsets" to compile all widgetsets or "ant widgetset-default",
"ant-widgetset-reserver", or "ant widgetset-colorpicker" to compile individual
-widgetsets. You must have GWT installed under build/gwt.
+widgetsets. You must have GWT installed under build/gwt, under the proper
+platform directory.
See http://dev.vaadin.com/wiki/DevDocs/StartingDevelopment for instructions for
installing GWT and compiling widgetsets for Vaadin development.
diff --git a/WebContent/VAADIN/themes/base/button/button.css b/WebContent/VAADIN/themes/base/button/button.css
index aacc05bbb7..9d4bec0fe4 100644
--- a/WebContent/VAADIN/themes/base/button/button.css
+++ b/WebContent/VAADIN/themes/base/button/button.css
@@ -23,7 +23,11 @@
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
- }
+}
+
+.v-button.v-disabled {
+ cursor: default;
+}
.v-ie6 .v-button {
display: inline;
diff --git a/WebContent/VAADIN/themes/base/styles.css b/WebContent/VAADIN/themes/base/styles.css
index f1840c6bf2..28d412536e 100644
--- a/WebContent/VAADIN/themes/base/styles.css
+++ b/WebContent/VAADIN/themes/base/styles.css
@@ -59,7 +59,11 @@
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
- }
+}
+
+.v-button.v-disabled {
+ cursor: default;
+}
.v-ie6 .v-button {
display: inline;
diff --git a/WebContent/VAADIN/themes/reindeer/button/button-link-style.css b/WebContent/VAADIN/themes/reindeer/button/button-link-style.css
index 14530c8dff..f4ba80b3cd 100644
--- a/WebContent/VAADIN/themes/reindeer/button/button-link-style.css
+++ b/WebContent/VAADIN/themes/reindeer/button/button-link-style.css
@@ -14,6 +14,11 @@
cursor: pointer;
line-height: inherit;
}
+
+.v-button.v-button-link.v-disabled,
+.v-button.v-button-link.v-disabled .v-button-wrap {
+ cursor: default;
+ }
.v-button-link .v-button-caption,
.v-nativebutton-link .v-nativebutton-caption {
diff --git a/WebContent/VAADIN/themes/reindeer/styles.css b/WebContent/VAADIN/themes/reindeer/styles.css
index afb15e49a8..c4d29c78ce 100644
--- a/WebContent/VAADIN/themes/reindeer/styles.css
+++ b/WebContent/VAADIN/themes/reindeer/styles.css
@@ -1,5 +1,5 @@
-.v-theme-version:after {content:"6_2_0_dev-20091229";}
-.v-theme-version-6_2_0_dev-20091229 {display: none;}
+.v-theme-version:after {content:"9_9_9_INTERNAL-DEBUG-BUILD";}
+.v-theme-version-9_9_9_INTERNAL-DEBUG-BUILD {display: none;}
/* Automatically compiled css file from subdirectories. */
.v-absolutelayout-wrapper {
@@ -59,7 +59,11 @@
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
- }
+}
+
+.v-button.v-disabled {
+ cursor: default;
+}
.v-ie6 .v-button {
display: inline;
@@ -2177,6 +2181,11 @@ div.v-window-header {
cursor: pointer;
line-height: inherit;
}
+
+.v-button.v-button-link.v-disabled,
+.v-button.v-button-link.v-disabled .v-button-wrap {
+ cursor: default;
+ }
.v-button-link .v-button-caption,
.v-nativebutton-link .v-nativebutton-caption {
diff --git a/WebContent/VAADIN/themes/runo/styles.css b/WebContent/VAADIN/themes/runo/styles.css
index 06bce5dfa9..7e14ce6d40 100644
--- a/WebContent/VAADIN/themes/runo/styles.css
+++ b/WebContent/VAADIN/themes/runo/styles.css
@@ -59,7 +59,11 @@
-moz-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
- }
+}
+
+.v-button.v-disabled {
+ cursor: default;
+}
.v-ie6 .v-button {
display: inline;
diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml
index 2e2c1b680e..584c9805bd 100644
--- a/WebContent/WEB-INF/web.xml
+++ b/WebContent/WEB-INF/web.xml
@@ -24,7 +24,7 @@
<servlet-name>VaadinApplicationRunner</servlet-name>
<servlet-class>com.vaadin.terminal.gwt.server.ApplicationRunnerServlet</servlet-class>
<init-param><param-name>defaultPackages</param-name>
- <param-value>com.vaadin.tests,com.vaadin.demo,com.vaadin.tests.tickets,com.vaadin.tests.components,com.vaadin.tests.components.layouts,com.vaadin.tests.components.panel,com.vaadin.tests.components.combobox,com.vaadin.tests.components.popupview,com.vaadin.tests.components.datefield,com.vaadin.tests.components.richtextarea,com.vaadin.tests.components.absolutelayout,com.vaadin.tests.components.embedded,com.vaadin.tests.components.splitpanel,com.vaadin.tests.components.abstractfield,com.vaadin.tests.components.form,com.vaadin.tests.components.table,com.vaadin.tests.components.accordion,com.vaadin.tests.components.label,com.vaadin.tests.components.tabsheet,com.vaadin.tests.components.beanitemcontainer,com.vaadin.tests.components.link,com.vaadin.tests.components.textfield,com.vaadin.tests.components.button,com.vaadin.tests.components.optiongroup,com.vaadin.tests.components.tree,com.vaadin.tests.components.caption,com.vaadin.tests.components.orderedlayout,com.vaadin.tests.components.window</param-value></init-param>
+ <param-value>com.vaadin.tests,com.vaadin.demo,com.vaadin.tests.tickets,com.vaadin.tests.components,com.vaadin.tests.components.layouts,com.vaadin.tests.components.panel,com.vaadin.tests.components.combobox,com.vaadin.tests.components.popupview,com.vaadin.tests.components.datefield,com.vaadin.tests.components.richtextarea,com.vaadin.tests.components.absolutelayout,com.vaadin.tests.components.embedded,com.vaadin.tests.components.splitpanel,com.vaadin.tests.components.abstractfield,com.vaadin.tests.components.form,com.vaadin.tests.components.table,com.vaadin.tests.components.accordion,com.vaadin.tests.components.label,com.vaadin.tests.components.tabsheet,com.vaadin.tests.components.beanitemcontainer,com.vaadin.tests.components.link,com.vaadin.tests.components.textfield,com.vaadin.tests.components.button,com.vaadin.tests.components.optiongroup,com.vaadin.tests.components.tree,com.vaadin.tests.components.caption,com.vaadin.tests.components.orderedlayout,com.vaadin.tests.components.window,com.vaadin.tests.dd</param-value></init-param>
</servlet>
diff --git a/WebContent/index.html b/WebContent/index.html
index 46bc8846fd..f7c4fe9c32 100644
--- a/WebContent/index.html
+++ b/WebContent/index.html
@@ -10,7 +10,7 @@
<script type="text/javascript">
window.onload = function() {
try {
- if(window.location.search && (window.location.search.indexOf('gwt.hosted') != -1 || window.location.search.indexOf('gwt.codesvr') != -1)) {
+ if(window.location.search && -1 != window.location.search.indexOf('gwt.hosted')) {
var hostedParam = window.location.search;
var demolinks = document.getElementsByTagName("a");
for (var k = 0; k < demolinks.length; k++) {
diff --git a/WebContent/multiapp.html b/WebContent/multiapp.html
index ddde191d28..0bee11e5bb 100644
--- a/WebContent/multiapp.html
+++ b/WebContent/multiapp.html
@@ -28,7 +28,7 @@
}};
</script>
<script language='javascript' src='/VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/com.vaadin.terminal.gwt.DefaultWidgetSet.nocache.js'></script>
-<link rel="stylesheet" type="text/css" href="/VAADIN/themes/example/styles.css"/>
+<link REL="stylesheet" TYPE="text/css" HREF="/VAADIN/themes/example/styles.css">
</head>
<body>
<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0;overflow:hidden" src="javascript:false"></iframe>
diff --git a/WebContent/release-notes.html b/WebContent/release-notes.html
index 0de559fda8..398e93d97c 100644
--- a/WebContent/release-notes.html
+++ b/WebContent/release-notes.html
@@ -34,125 +34,13 @@
<li><a href="#requirements">Requirements</a></li>
</ul>
-<p>Vaadin @version@ is an update release for Vaadin 6. In addition to various fixes, it
-contains a number of significant enhancements.</p>
+<p>Vaadin @version@ is a maintenance release for Vaadin 6.2,
+containing a number of important fixes. The fixes are listed in the <a
+href="#changelog">Change Log</a> below.</p>
-<ul>
- <li>Widget set definition and component-to-widget mapping has been redesigned</li>
- <ul>
- <li>Reuse of widgets is now much easier, as it is easier to package and use widget
- set JARs and otherwise combine widget sets.</li>
-
- <li>A widget set definition class is no longer used. The Java
- code needed for widget instantiation and client-server mapping is now
- automatically generated by the GWT compiler. For the basic Vaadin
- user, a widget set is now defined only in a GWT module definition file
- (<tt>.gwt.xml</tt>).</li>
-
- <li>Server-side component is mapped to a client-side widget with an annotation:
- <pre>@ClientWidget(com.vaadin.demo.colorpicker.gwt.client.ui.VColorPicker.class)
-public class ColorPicker extends AbstractField {</pre>
- </li>
-
- <li>The <tt>getTag()</tt> method is no longer needed</li>
-
- <li>The Vaadin Plugin for Eclipse can create new widget stubs, define the mapping,
- and create widget set definition files (<tt>.gwt.xml</tt>).</li>
-
- <li>See <tt>WebContent/docs/example-source/build-widgetset.xml</tt> for an example
- on how you can compile widget sets and widget set JARs with Ant.</li>
-
- <li>A widget set builder allows automatic generation and maintenance of widget
- configurations, making use of widget set JARs easier.</li>
-
- <li>See <a href="#widgetupgrade">notes below</a> for upgrading widget set
- definitions and widget mappings from earlier version of Vaadin 6.</li>
- </ul>
- <li>Other enhancements to development of new components</li>
- <ul>
- <li>On the server-side:</li>
- <ul>
- <li>Listeners for custom client side events are now easier to implement with
- <tt>ReflectTools.findMethod()</tt> and <tt>addListener(String eventIdentifier,
- Class&lt;?&gt; eventType, Object target, Method method)</tt> methods. The latter
- automatically informs the client-side that a listener is registered on server side)</li>
- </ul>
- <li>On the client-side:</li>
- <ul>
- <li>Ability to check if a listener is registered on the server-side</li>
- <li>Typed arrays and maps can now be sent to server with <tt>updateVariable()</tt>
- <ul>
- <li><b>Note!</b> This change affects existing custom components that send object arrays to the server.
- Previously, an <tt>Object[]</tt> sent from client to server was converted into <tt>String[]</tt> on the server-side.
- This invalid behavior is now fixed and an <tt>Object[]</tt> sent from client-side is an
- <tt>Object[]</tt> on the server-side.</li>
- </ul>
- </li>
- </ul>
- </ul>
- <li>Portlet 2.0 (JSR 268) support</li>
- <ul>
- <li>A separate servlet for each portlet is no longer needed.
- (no separate servlet, no session problems, portlet-to-portlet communication, etc)</li>
- </ul>
- <li>OSGi support</li>
- <ul>
- <li>Vaadin now works as a OSGi bundle.</li>
- </ul>
- <li>Enhanced sorting of <b>IndexedContainer</b> and <b>BeanItemContainer</b></li>
- <ul>
- <li>Custom sort methods can now be used to sort container contents.</li>
- </ul>
- <li>Improved event support</li>
- <ul>
- <li>Client-side events are sent to the server only when a listener has been registered for the event</li>
- <li>All built-in layouts (<b>AbsoluteLayout</b>, <b>CssLayout</b>, <b>HorizontalLayout</b>, <b>GridLayout</b>, and <b>VerticalLayout</b>) now support click listeners.</li>
- <li>Click events for <b>Panel</b> and <b>Embedded</b>.</li>
- <li>Focus and blur events for <b>DateField</b>, <b>TextField</b>, and <b>Select</b></li>
- </ul>
- <li>JavaScript execution with <tt>Window.excecuteJavaScript()</tt></li>
- <ul>
- <li>You can execute JavaScript directly from the server-side with the new <tt>excecuteJavaScript()</tt> method. You can use it, for example, for integration with other systems or for implementing print functionality (<tt>window.print()</tt>). </li>
- </ul>
- <li>Additional Maven archetypes</li>
- <ul>
- <li><b>vaadin-archetype-clean</b> with a dependency to Vaadin and a minimal application skeleton, no client-side widgets</li>
- <li><b>vaadin-archetype-widget</b> for creation of Vaadin 6.2 widget packages</li>
- <li><b>vaadin-archetype-sample</b> has been updated for Vaadin 6.2 - use version 1.0.x for earlier versions of Vaadin</li>
- </ul>
- <li>Maven Vaadin plugin</li>
- <ul>
- <li><b>vaadin-maven-plugin</b> can automatically update Vaadin 6.2 widget sets based on Maven dependencies using the goal <tt>update-widgetset</tt></li>
- </ul>
- <li><b>HttpServletRequestListener</b></li>
- <ul>
- <li>Similar to <b>TransactionListener</b>, but only related to a single Application. Called before and after every servlet request and provides access to <b>HttpServletRequest</b> and <b>HttpServletResponse</b>.</li>
- </ul>
- <li><b>PortletRequestListener</b>
- <ul>
- <li>Similar to <b>HttpServletRequestListener</b>, but for portlets. Called before and after every portlet request and provides access to <b>PortletRequest</b> and <b>PortletResponse</b>.</li>
- </ul>
- <li>Enhancements for the Portlet 2.0 support (<a href="http://dev.vaadin.com/ticket/3918">#3918</a>)</li>
- <ul>
- <li>Support for the edit and help modes</li>
- <li>Support for custom modes and changing modes programmatically</li>
- <li>See <a href="http://dev.vaadin.com/browser/versions/6.2/demo/src/com/vaadin/demo/portlet/PortletModeExample.java"><tt>com/vaadin/demo/portlet/PortletModeExample.java</tt></a> in the demo source code in the installation package for an example</li>
- </ul>
- <li>Enhancements to various components:</li>
- <ul>
- <li><b>Window</b>: Additional control over a sub-window: close and drag prevention.</li>
- <li><b>Tree</b>: Item style generator enabling styling of individual tree items. Rendering optimizations.</li>
- <li><b>Tabsheet</b>: Tabs can be marked as closable. The new <b>CloseHandler</b> can be used to ask for confirmation, prevent closing etc.</li>
- <li><b>SplitPanel</b>: Double-clicking the splitter sends an event which can be handled on server-side.</li>
- <li><b>MenuBar</b>: Many enhancements: individual items can be styled, support for separators, disabling of items, visibility of items.</li>
- <li><b>DateField</b>: Support for lenient/non-lenient mode. A <b>DateField</b> is now by default in non-lenient mode (only accepts valid dates). </li>
- </ul>
- <li>Automatic integration tests</li>
- <ul>
- <li>All Vaadin builds are now automatically tested on all supported servers.</li>
- </ul>
- <li>Dozens of other small enhancements and bug fixes</li>
-</ul>
+<p>For recent major enhancements, see the <a
+href="http://vaadin.com/download/release/6.2/6.2.0/release-notes.html">Release
+Notes for Vaadin 6.2.0</a>.</p>
<p>Problem fixes and enhancements planned for upcoming releases can be found from the <a
href="http://dev.vaadin.com/roadmap">Vaadin Roadmap</a> in Vaadin Trac.</p>
@@ -162,6 +50,26 @@ widget sets and refresh your project in Eclipse. If you are upgrading from earli
6.2.0, notice that Vaadin 6.2 uses GWT 1.7.0 (included in the installation package). See
<a href="#upgrading">General Upgrade Notes</a> for more details on upgrading.</p>
+<h2><a name="changelog">Change Log</a></h2>
+
+<p>The following closed issues have been included in this release:</p>
+
+<ul>
+ <li><a href="http://dev.vaadin.com/ticket/3804">#3804</a>: SPAN-tag inside a disabled button class has cursor: pointer</li>
+ <li><a href="http://dev.vaadin.com/ticket/3976">#3976</a>: LoginForm should use POST and not GET to avoid storing passwords in logs</li>
+ <li><a href="http://dev.vaadin.com/ticket/4010">#4010</a>: Widgets with variables of type array with value null causes 'Internal Error' in Vaadin</li>
+ <li><a href="http://dev.vaadin.com/ticket/4017">#4017</a>: Document UriFragmentUtility</li>
+ <li><a href="http://dev.vaadin.com/ticket/4019">#4019</a>: VGridLayout throws an NPE when moving component to where another was removed</li>
+ <li><a href="http://dev.vaadin.com/ticket/4025">#4025</a>: "ClassPathExplorer should ignore empty ""Vaadin-Widgetsets"" attribute"</li>
+ <li><a href="http://dev.vaadin.com/ticket/4036">#4036</a>: Defined width DateField clips in a layout with undefined size</li>
+ <li><a href="http://dev.vaadin.com/ticket/4064">#4064</a>: FileTypeResolver should ignore query parameters when determining file type</li>
+ <li><a href="http://dev.vaadin.com/ticket/4067">#4067</a>: SplitPanel in modal window freezes application (Gecko+Webkit)</li>
+ <li><a href="http://dev.vaadin.com/ticket/4086">#4086</a>: Include an Index at the end of the Book</li>
+ <li><a href="http://dev.vaadin.com/ticket/4099">#4099</a>: UriFragmentUtility does not work in Opera</li>
+ <li><a href="http://dev.vaadin.com/ticket/4100">#4100</a>: ClassCastException in ClassPathExplorer</li>
+ <li><a href="http://dev.vaadin.com/ticket/4103">#4103</a>: Empty required Select shows error indicator while other fields don't</li>
+</ul>
+
<h2><a name="widgetupgrade">Upgrading from an Earlier Version of Vaadin 6</a></h2>
<p>
@@ -376,101 +284,6 @@ sets with the regular Vaadin package for your platform.</p>
<p>For other known problems, see open tickets at developer site <a
href="http://dev.vaadin.com/">dev.vaadin.com</a>.</p>
-<h2><a name="changelog">Change Log</a></h2>
-
-<p>The following closed issues have been included in this release:</p>
-
-<ul>
-<li><a href="http://dev.vaadin.com/ticket/1595">#1595</a>: Close button on TabSheet control</li>
-<li><a href="http://dev.vaadin.com/ticket/2594">#2594</a>: Add support for native JSON evaluation in UIDL parsing</li>
-<li><a href="http://dev.vaadin.com/ticket/2632">#2632</a>: Notifications should not be wider than the screen</li>
-<li><a href="http://dev.vaadin.com/ticket/2821">#2821</a>: Sumbenu icon is not aligned with the menu item's text</li>
-<li><a href="http://dev.vaadin.com/ticket/2849">#2849</a>: Deprecate MenuBar.setSubmenuIcon method, and provide the same functionality via CSS</li>
-<li><a href="http://dev.vaadin.com/ticket/2854">#2854</a>: Paintable should be an appropriate variable type</li>
-<li><a href="http://dev.vaadin.com/ticket/2918">#2918</a>: Same application is loaded in different portlet instances</li>
-<li><a href="http://dev.vaadin.com/ticket/3070">#3070</a>: Tree's Items should be easily styled</li>
-<li><a href="http://dev.vaadin.com/ticket/3088">#3088</a>: ComboBox, If only one item is listed, pressing Enter should choose it, not discard</li>
-<li><a href="http://dev.vaadin.com/ticket/3117">#3117</a>: Portlet 2.0 (JSR-286) support</li>
-<li><a href="http://dev.vaadin.com/ticket/3120">#3120</a>: Window.setClosable(boolean)</li>
-<li><a href="http://dev.vaadin.com/ticket/3133">#3133</a>: Window draggability disabling feature</li>
-<li><a href="http://dev.vaadin.com/ticket/3175">#3175</a>: Date Field "too big" date handling</li>
-<li><a href="http://dev.vaadin.com/ticket/3185">#3185</a>: Add possibility to specify application CSS class name (Patch to make it easier to use Vaadin with Jython)</li>
-<li><a href="http://dev.vaadin.com/ticket/3230">#3230</a>: Sub window should not be dragged or resized when the cursor is outside the browser window</li>
-<li><a href="http://dev.vaadin.com/ticket/3234">#3234</a>: Component Event Listener Framework for all widgets/components</li>
-<li><a href="http://dev.vaadin.com/ticket/3259">#3259</a>: Removing all action handlers</li>
-<li><a href="http://dev.vaadin.com/ticket/3277">#3277</a>: MenuBar.MenuItem could have setVisible() method</li>
-<li><a href="http://dev.vaadin.com/ticket/3298">#3298</a>: Split sources to several folders</li>
-<li><a href="http://dev.vaadin.com/ticket/3332">#3332</a>: Redesign how widgets are packaged and how the widgetset is built</li>
-<li><a href="http://dev.vaadin.com/ticket/3338">#3338</a>: Create a Maven archetype for creating a widget project</li>
-<li><a href="http://dev.vaadin.com/ticket/3367">#3367</a>: It should be possible to specify parameters for embedded flash</li>
-<li><a href="http://dev.vaadin.com/ticket/3416">#3416</a>: Theme should contain Vaadin version</li>
-<li><a href="http://dev.vaadin.com/ticket/3433">#3433</a>: BeanItemContainer's sort is not overridable</li>
-<li><a href="http://dev.vaadin.com/ticket/3434">#3434</a>: IndexedContainer's compare is not overridable</li>
-<li><a href="http://dev.vaadin.com/ticket/3451">#3451</a>: ComboBox causes internal error when changing page too fast</li>
-<li><a href="http://dev.vaadin.com/ticket/3472">#3472</a>: Give better error message if widgetset can not be loaded</li>
-<li><a href="http://dev.vaadin.com/ticket/3473">#3473</a>: Detect if UIDL request returns 404 and show an error message</li>
-<li><a href="http://dev.vaadin.com/ticket/3479">#3479</a>: Embedded applications should not change the page title</li>
-<li><a href="http://dev.vaadin.com/ticket/3483">#3483</a>: PopupView rendering style inside a layout is unspecified</li>
-<li><a href="http://dev.vaadin.com/ticket/3498">#3498</a>: Window doesn't get focus correctly</li>
-<li><a href="http://dev.vaadin.com/ticket/3499">#3499</a>: PopupView CSS style is broken</li>
-<li><a href="http://dev.vaadin.com/ticket/3526">#3526</a>: SplitPanel collapse and expand with doubleclick</li>
-<li><a href="http://dev.vaadin.com/ticket/3541">#3541</a>: VerticalLayout//HorizontalLayout/GridLayout/AbsoluteLayout/CSSLayout should support click events</li>
-<li><a href="http://dev.vaadin.com/ticket/3544">#3544</a>: Implement support for focus/blur events in TextField</li>
-<li><a href="http://dev.vaadin.com/ticket/3565">#3565</a>: CommunicationManager is not serializable</li>
-<li><a href="http://dev.vaadin.com/ticket/3580">#3580</a>: MenuBar stylenames aren't added to the submenu overlays</li>
-<li><a href="http://dev.vaadin.com/ticket/3589">#3589</a>: Window.executeJavaScript()</li>
-<li><a href="http://dev.vaadin.com/ticket/3603">#3603</a>: No DTD in generated GWT descriptor</li>
-<li><a href="http://dev.vaadin.com/ticket/3605">#3605</a>: Patch to avoid concurrent modification exceptions in EventRouter</li>
-<li><a href="http://dev.vaadin.com/ticket/3631">#3631</a>: LoginForm login button is too wide in IE6/IE7</li>
-<li><a href="http://dev.vaadin.com/ticket/3654">#3654</a>: Decide on final PaintTarget.paintReference(Paintable, String) API</li>
-<li><a href="http://dev.vaadin.com/ticket/3655">#3655</a>: ApplicationRunner logs unnecessary java.lang.ClassNotFoundExceptions</li>
-<li><a href="http://dev.vaadin.com/ticket/3678">#3678</a>: MenuBar needs a separator item</li>
-<li><a href="http://dev.vaadin.com/ticket/3683">#3683</a>: TextField.setRows() API needs reworking</li>
-<li><a href="http://dev.vaadin.com/ticket/3688">#3688</a>: ContainerHierarchicalWrapper should stay ordered by the wrapped container</li>
-<li><a href="http://dev.vaadin.com/ticket/3715">#3715</a>: Sub windows are shown as VView in debug console</li>
-<li><a href="http://dev.vaadin.com/ticket/3717">#3717</a>: Parameterize BeanItem and ComponentContainer.getComponentIterator</li>
-<li><a href="http://dev.vaadin.com/ticket/3721">#3721</a>: ComboBox can insert only new item without losing its focus</li>
-<li><a href="http://dev.vaadin.com/ticket/3731">#3731</a>: Implement a simpler alternative to ApplicationContext.TransactionListener</li>
-<li><a href="http://dev.vaadin.com/ticket/3740">#3740</a>: Tabsheet no longer fully serializable, doesn't work in GAE</li>
-<li><a href="http://dev.vaadin.com/ticket/3754">#3754</a>: Add data.util.TextFileProperty</li>
-<li><a href="http://dev.vaadin.com/ticket/3755">#3755</a>: Select throws IllegalArgumentException when browsing pages quickly</li>
-<li><a href="http://dev.vaadin.com/ticket/3756">#3756</a>: Add support for passing a typed Object[] from client to server</li>
-<li><a href="http://dev.vaadin.com/ticket/3757">#3757</a>: Add support for passing a typed map from client to server</li>
-<li><a href="http://dev.vaadin.com/ticket/3759">#3759</a>: Cannot scroll to the last tab in a Tabsheet</li>
-<li><a href="http://dev.vaadin.com/ticket/3760">#3760</a>: Scrollbars are missing in Safari/Chrome</li>
-<li><a href="http://dev.vaadin.com/ticket/3761">#3761</a>: MenuBar breaks the application completely</li>
-<li><a href="http://dev.vaadin.com/ticket/3762">#3762</a>: Dependency to javax/portlet/PortletRequest, won't work with GAE</li>
-<li><a href="http://dev.vaadin.com/ticket/3763">#3763</a>: Add javadoc to public methods in ApplicationConnection</li>
-<li><a href="http://dev.vaadin.com/ticket/3772">#3772</a>: Add notifier interfaces for focus and blur events</li>
-<li><a href="http://dev.vaadin.com/ticket/3775">#3775</a>: Optimize Tree rendering</li>
-<li><a href="http://dev.vaadin.com/ticket/3782">#3782</a>: ClassCastException when adding Window via addComponent</li>
-<li><a href="http://dev.vaadin.com/ticket/3783">#3783</a>: ClickListener in Panel does not work</li>
-<li><a href="http://dev.vaadin.com/ticket/3784">#3784</a>: Panel.setScrollTop does not work with invalid values</li>
-<li><a href="http://dev.vaadin.com/ticket/3785">#3785</a>: Style names for MenuBar.MenuItem</li>
-<li><a href="http://dev.vaadin.com/ticket/3786">#3786</a>: Add focus and blur events to Select/VFilterSelect and DateField/VTextualDate</li>
-<li><a href="http://dev.vaadin.com/ticket/3788">#3788</a>: Typo in setWriteThrough's parameter name</li>
-<li><a href="http://dev.vaadin.com/ticket/3807">#3807</a>: LoginForm doesn't work when multiple windows are used for the same application</li>
-<li><a href="http://dev.vaadin.com/ticket/3817">#3817</a>: Upload: Browsers send different filenames</li>
-<li><a href="http://dev.vaadin.com/ticket/3819">#3819</a>: Document that widgetset compiler loads classes</li>
-<li><a href="http://dev.vaadin.com/ticket/3820">#3820</a>: DefaultItemSorter is not serializable</li>
-<li><a href="http://dev.vaadin.com/ticket/3824">#3824</a>: Make sure build generates theme version</li>
-<li><a href="http://dev.vaadin.com/ticket/3825">#3825</a>: AbstractComponentThrows NPE when both visible and enable is set to false</li>
-<li><a href="http://dev.vaadin.com/ticket/3828">#3828</a>: TextField inside a layout inside a Table is clipped</li>
-<li><a href="http://dev.vaadin.com/ticket/3835">#3835</a>: Portlet 2.0 does not support the "style" parameter</li>
-<li><a href="http://dev.vaadin.com/ticket/3843">#3843</a>: Form caption is blue in IE</li>
-<li><a href="http://dev.vaadin.com/ticket/3845">#3845</a>: Twincol select buttons are missing right border in IE6</li>
-<li><a href="http://dev.vaadin.com/ticket/3849">#3849</a>: Undefined wide menubar is 100% wide in IE6</li>
-<li><a href="http://dev.vaadin.com/ticket/3850">#3850</a>: Submenu icon is placed outside the menu in IE7</li>
-<li><a href="http://dev.vaadin.com/ticket/3859">#3859</a>: Application contains mysterious deprecated methods</li>
-<li><a href="http://dev.vaadin.com/ticket/3874">#3874</a>: Two click events is sent for a middle click in a layout</li>
-<li><a href="http://dev.vaadin.com/ticket/3879">#3879</a>: Removing portlet leaks memory</li>
-<li><a href="http://dev.vaadin.com/ticket/3881">#3881</a>: MenuBar collapsing slightly broken with Reindeer theme</li>
-<li><a href="http://dev.vaadin.com/ticket/3883">#3883</a>: Extra white space at top when navigating in sampler with IE8</li>
-<li><a href="http://dev.vaadin.com/ticket/3884">#3884</a>: Menubar with collapsed menus does not handle resize events properly</li>
-<li><a href="http://dev.vaadin.com/ticket/3885">#3885</a>: Menubar with collapsed menus does not show arrow for showing collapsed items</li>
-<li><a href="http://dev.vaadin.com/ticket/3886">#3886</a>: InputPrompt of TextField/Combobox does not change until refresh</li>
-</ul>
-
<h2><a name="requirements">Requirements</a></h2>
<p>Vaadin is available for the following operating systems:</p>
diff --git a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java
index 6420aaf838..d516c870a2 100644
--- a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java
+++ b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java
@@ -129,16 +129,6 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
return 0;
}
};
- Object[] array = roots.toArray();
- Arrays.sort(array, basedOnOrderFromWrappedContainer);
- roots = new LinkedHashSet<Object>();
- for (int i = 0; i < array.length; i++) {
- roots.add(array[i]);
- }
- for (Object object : children.keySet()) {
- LinkedList<Object> object2 = children.get(object);
- Collections.sort(object2, basedOnOrderFromWrappedContainer);
- }
// Calculate the set of all items in the hierarchy
final HashSet<Object> s = new HashSet<Object>();
@@ -163,6 +153,18 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
s.add(id);
}
}
+
+ Object[] array = roots.toArray();
+ Arrays.sort(array, basedOnOrderFromWrappedContainer);
+ roots = new LinkedHashSet<Object>();
+ for (int i = 0; i < array.length; i++) {
+ roots.add(array[i]);
+ }
+ for (Object object : children.keySet()) {
+ LinkedList<Object> object2 = children.get(object);
+ Collections.sort(object2, basedOnOrderFromWrappedContainer);
+ }
+
}
}
}
@@ -204,6 +206,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical,
*/
private void addToHierarchyWrapper(Object itemId) {
roots.add(itemId);
+
}
/*
diff --git a/src/com/vaadin/data/util/HierarchicalContainer.java b/src/com/vaadin/data/util/HierarchicalContainer.java
index f5b65f1dad..2b5519e651 100644
--- a/src/com/vaadin/data/util/HierarchicalContainer.java
+++ b/src/com/vaadin/data/util/HierarchicalContainer.java
@@ -139,6 +139,25 @@ public class HierarchicalContainer extends IndexedContainer implements
return true;
}
+ @Override
+ public Item addItemAt(int index, Object newItemId) {
+ Item retval = super.addItemAt(index, newItemId);
+ if (getParent(newItemId) == null) {
+ int refIndex = roots.size() - 1;
+ int indexOfId = indexOfId(roots.get(refIndex));
+ while (indexOfId > index) {
+ refIndex--;
+ if (refIndex < 0) {
+ // inserts as first
+ break;
+ }
+ indexOfId = indexOfId(roots.get(refIndex));
+ }
+ roots.add(refIndex + 1, newItemId);
+ }
+ return retval;
+ }
+
/**
* <p>
* Sets the parent of an Item. The new parent item must exist and be able to
@@ -293,7 +312,12 @@ public class HierarchicalContainer extends IndexedContainer implements
if (isRoot(itemId)) {
roots.remove(itemId);
}
- children.remove(itemId);
+ LinkedList<Object> remove = children.remove(itemId);
+ if (remove != null) {
+ for (Object object : remove) {
+ removeItem(object);
+ }
+ }
final Object p = parent.get(itemId);
if (p != null) {
final LinkedList c = children.get(p);
diff --git a/src/com/vaadin/data/util/IndexedContainer.java b/src/com/vaadin/data/util/IndexedContainer.java
index f5dddf5e23..d6d6d9e77c 100644
--- a/src/com/vaadin/data/util/IndexedContainer.java
+++ b/src/com/vaadin/data/util/IndexedContainer.java
@@ -557,6 +557,9 @@ public class IndexedContainer implements Container.Indexed,
return null;
}
}
+ if (index < 0) {
+ index = 0;
+ }
return addItemAt(index, newItemId);
}
diff --git a/src/com/vaadin/launcher/DevelopmentServerLauncher.java b/src/com/vaadin/launcher/DevelopmentServerLauncher.java
index 1ba7e69da0..68470937b3 100644
--- a/src/com/vaadin/launcher/DevelopmentServerLauncher.java
+++ b/src/com/vaadin/launcher/DevelopmentServerLauncher.java
@@ -12,8 +12,6 @@ import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;
-import com.vaadin.launcher.util.BrowserLauncher;
-
/**
* Class for running Jetty servlet container within Eclipse project.
*
@@ -42,7 +40,7 @@ public class DevelopmentServerLauncher {
// Start Browser
System.out.println("Starting Web Browser.");
if (url != null) {
- BrowserLauncher.openBrowser(url);
+ // BrowserLauncher.openBrowser(url);
}
}
diff --git a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
index d7cf1ca4d0..3aaf2e5d1b 100644
--- a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
+++ b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml
@@ -14,10 +14,6 @@
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.http.HTTP" />
-
- <inherits name="com.google.gwt.xml.XML" />
-
- <inherits name="com.google.gwt.json.JSON" />
<source path="client" />
@@ -27,10 +23,18 @@
<when-property-is name="user.agent" value="ie6"/>
</replace-with>
+ <!-- Opera needs a different implementation due to GWT issue 3956 (#4099) -->
+ <replace-with class="com.google.gwt.user.client.impl.HistoryImplTimer">
+ <when-type-is class="com.google.gwt.user.client.impl.HistoryImpl" />
+ <when-property-is name="user.agent" value="opera" />
+ </replace-with>
+
<generate-with class="com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator">
<when-type-is class="com.vaadin.terminal.gwt.client.WidgetMap"/>
</generate-with>
<entry-point class="com.vaadin.terminal.gwt.client.DefaultWidgetSet" />
+ <set-property name="user.agent" value="safari,gecko1_8"/>
+
</module>
diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
index 1c3128dbdf..bd35acddd7 100755
--- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
+++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
@@ -40,6 +40,7 @@ import com.vaadin.terminal.gwt.client.ui.VContextMenu;
import com.vaadin.terminal.gwt.client.ui.VNotification;
import com.vaadin.terminal.gwt.client.ui.VView;
import com.vaadin.terminal.gwt.client.ui.VNotification.HideEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager;
import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
/**
@@ -596,7 +597,7 @@ public class ApplicationConnection {
for (int i = 1; i < variableBurst.size(); i += 2) {
String id = variableBurst.get(i);
id = id.substring(0, id.indexOf(VAR_FIELD_SEPARATOR));
- if (!idToPaintableDetail.containsKey(id)) {
+ if (!idToPaintableDetail.containsKey(id) && !id.startsWith("DD")) {
// variable owner does not exist anymore
variableBurst.remove(i - 1);
variableBurst.remove(i - 1);
@@ -805,6 +806,12 @@ public class ApplicationConnection {
}
}
+ if (json.containsKey("dd")) {
+ // response contains data for drag and drop service
+ DragAndDropManager.get().handleServerResponse(
+ json.getValueMap("dd"));
+ }
+
// Check which widgets' size has been updated
Set<Paintable> sizeUpdatedWidgets = new HashSet<Paintable>();
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java
index 2a7ee079a9..8e423523ab 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VAbsoluteLayout.java
@@ -158,9 +158,12 @@ public class VAbsoluteLayout extends ComplexPanel implements Container {
for (Iterator<Object> childIterator = uidl.getChildIterator(); childIterator
.hasNext();) {
UIDL cc = (UIDL) childIterator.next();
- UIDL componentUIDL = cc.getChildUIDL(0);
- unrenderedPids.remove(componentUIDL.getId());
- getWrapper(client, componentUIDL).updateFromUIDL(cc);
+ // skip the last one (support for VDragDropPane
+ if (childIterator.hasNext()) {
+ UIDL componentUIDL = cc.getChildUIDL(0);
+ unrenderedPids.remove(componentUIDL.getId());
+ getWrapper(client, componentUIDL).updateFromUIDL(cc);
+ }
}
for (String pid : unrenderedPids) {
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java b/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
index 1c2fcf5b6f..416455c162 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VGridLayout.java
@@ -191,6 +191,7 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
renderRemainingComponents(pendingCells);
for (Cell cell : relativeHeighted) {
+ // rendering done above so cell.cc should not be null
Widget widget2 = cell.cc.getWidget();
client.handleComponentRelativeSize(widget2);
cell.cc.updateWidgetSize();
@@ -685,19 +686,20 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
Cell cell = paintableToCell.get(paintable);
if (!cell.hasRelativeHeight() || !cell.hasRelativeWidth()) {
// cell sizes will only stay still if only relatively
- // sized
- // components
+ // sized components
// check if changed child affects min col widths
- cell.cc.setWidth("");
- cell.cc.setHeight("");
+ if (cell.cc != null) {
+ cell.cc.setWidth("");
+ cell.cc.setHeight("");
- cell.cc.updateWidgetSize();
+ cell.cc.updateWidgetSize();
- /*
- * If this is the result of an caption icon onload event the
- * caption size may have changed
- */
- cell.cc.updateCaptionSize();
+ /*
+ * If this is the result of an caption icon onload event the
+ * caption size may have changed
+ */
+ cell.cc.updateCaptionSize();
+ }
int width = cell.getWidth();
int allocated = columnWidths[cell.col];
@@ -853,9 +855,16 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
}
public RenderSpace getAllocatedSpace() {
- return new RenderSpace(getAvailableWidth()
- - cc.getCaptionWidthAfterComponent(), getAvailableHeight()
- - cc.getCaptionHeightAboveComponent());
+ if (cc != null) {
+ return new RenderSpace(getAvailableWidth()
+ - cc.getCaptionWidthAfterComponent(),
+ getAvailableHeight()
+ - cc.getCaptionHeightAboveComponent());
+ } else {
+ // this should not happen normally
+ return new RenderSpace(getAvailableWidth(),
+ getAvailableHeight());
+ }
}
public boolean hasContent() {
@@ -965,6 +974,8 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
int rowspan = 1;
UIDL childUidl;
int alignment;
+ // may be null after setUidl() if content has vanished or changed, set
+ // in render()
ChildComponentContainer cc;
public void setUidl(UIDL c) {
@@ -986,21 +997,21 @@ public class VGridLayout extends SimplePanel implements Paintable, Container {
if (childUidl != null) {
if (c == null) {
// content has vanished, old content will be removed from
- // canvas
- // later durin render phase
+ // canvas later during the render phase
cc = null;
} else if (cc != null
&& cc.getWidget() != client.getPaintable(c)) {
// content has changed
- cc = null;
- if (widgetToComponentContainer.containsKey(client
- .getPaintable(c))) {
- // cc exist for this component (moved) use that for this
- // cell
- cc = widgetToComponentContainer.get(client
- .getPaintable(c));
+ Paintable newPaintable = client.getPaintable(c);
+ if (widgetToComponentContainer.containsKey(newPaintable)) {
+ // if a key in the map, newPaintable must be a widget
+ replaceChildComponent(cc.getWidget(),
+ (Widget) newPaintable);
+ cc = widgetToComponentContainer.get(newPaintable);
cc.setWidth("");
cc.setHeight("");
+ } else {
+ cc = null;
}
}
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
index 8520e52eec..a680835126 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
@@ -40,6 +40,8 @@ import com.vaadin.terminal.gwt.client.RenderSpace;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
import com.vaadin.terminal.gwt.client.ui.VScrollTable.VScrollTableBody.VScrollTableRow;
+import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager;
+import com.vaadin.terminal.gwt.client.ui.dd.Transferable;
/**
* VScrollTable
@@ -148,6 +150,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
private String height;
private String width = "";
private boolean rendering = false;
+ private int dragmode;
public VScrollTable() {
bodyContainer.addScrollHandler(this);
@@ -190,6 +193,9 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
totalRows = newTotalRows;
}
+ dragmode = uidl.hasAttribute("dragmode") ? uidl
+ .getIntAttribute("dragmode") : 0;
+
setCacheRate(uidl.hasAttribute("cr") ? uidl.getDoubleAttribute("cr")
: CACHE_RATE_DEFAULT);
@@ -2228,13 +2234,14 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
private String[] actionKeys = null;
private final TableRowElement rowElement;
+ private boolean mDown;
private VScrollTableRow(int rowKey) {
this.rowKey = rowKey;
rowElement = Document.get().createTRElement();
setElement(rowElement);
- DOM.sinkEvents(getElement(), Event.ONMOUSEUP | Event.ONDBLCLICK
- | Event.ONCONTEXTMENU);
+ DOM.sinkEvents(getElement(), Event.MOUSEEVENTS
+ | Event.ONDBLCLICK | Event.ONCONTEXTMENU);
}
private void paintComponent(Paintable p, UIDL uidl) {
@@ -2458,6 +2465,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
handleClickEvent(event, targetTdOrTr);
break;
case Event.ONMOUSEUP:
+ mDown = false;
handleClickEvent(event, targetTdOrTr);
if (event.getButton() == Event.BUTTON_LEFT
&& selectMode > Table.SELECT_MODE_NONE) {
@@ -2479,6 +2487,31 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
case Event.ONCONTEXTMENU:
showContextMenu(event);
break;
+ case Event.ONMOUSEDOWN:
+ if (dragmode != 0) {
+ mDown = true;
+ event.preventDefault();
+ }
+ break;
+ case Event.ONMOUSEOUT:
+ mDown = false;
+ break;
+ case Event.ONMOUSEMOVE:
+ if (mDown && dragmode != 0) {
+ Transferable transferable = new Transferable();
+ transferable.setComponent(VScrollTable.this);
+ transferable.setItemId("" + rowKey);
+
+ // TODO propertyId
+ com.vaadin.terminal.gwt.client.ui.dd.DragEvent ev = DragAndDropManager
+ .get().startDrag(transferable, event,
+ true);
+ Element cloneNode = (Element) getElement()
+ .cloneNode(true);
+ cloneNode.getStyle().setOpacity(0.4);
+ ev.setDragImage(cloneNode);
+ mDown = false;
+ }
default:
break;
}
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
index 3394821efb..f3fa28c656 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VTree.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VTree.java
@@ -9,7 +9,11 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import com.google.gwt.dom.client.NativeEvent;
+import com.google.gwt.dom.client.Style;
+import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
@@ -22,11 +26,20 @@ import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.Paintable;
import com.vaadin.terminal.gwt.client.UIDL;
import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.ValueMap;
+import com.vaadin.terminal.gwt.client.ui.dd.AbstractDropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.AcceptCallback;
+import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager;
+import com.vaadin.terminal.gwt.client.ui.dd.DragEvent;
+import com.vaadin.terminal.gwt.client.ui.dd.DropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.HasDropHandler;
+import com.vaadin.terminal.gwt.client.ui.dd.Transferable;
+import com.vaadin.terminal.gwt.client.ui.dd.DragAndDropManager.DragEventType;
/**
*
*/
-public class VTree extends FlowPanel implements Paintable {
+public class VTree extends FlowPanel implements Paintable, HasDropHandler {
public static final String CLASSNAME = "v-tree";
@@ -37,6 +50,7 @@ public class VTree extends FlowPanel implements Paintable {
private String paintableId;
private boolean selectable;
private boolean isMultiselect;
+ private String currentMouseOverKey;
private final HashMap<String, TreeNode> keyToNode = new HashMap<String, TreeNode>();
@@ -56,6 +70,10 @@ public class VTree extends FlowPanel implements Paintable {
private boolean rendering;
+ private int dragModes;
+
+ private AbstractDropHandler dropHandler;
+
public VTree() {
super();
setStyleName(CLASSNAME);
@@ -116,6 +134,9 @@ public class VTree extends FlowPanel implements Paintable {
if ("actions".equals(childUidl.getTag())) {
updateActionMap(childUidl);
continue;
+ } else if ("dh".equals(childUidl.getTag())) {
+ updateDropHandler(childUidl);
+ continue;
}
final TreeNode childTree = new TreeNode();
if (childTree.ie6compatnode != null) {
@@ -132,10 +153,161 @@ public class VTree extends FlowPanel implements Paintable {
selectedIds = uidl.getStringArrayVariableAsSet("selected");
+ if (uidl.hasAttribute("dragModes")) {
+ dragModes = uidl.getIntAttribute("dragModes");
+ }
+
rendering = false;
}
+ private void updateTreeRelatedTransferData(DragEvent drag) {
+ drag.getTransferrable().setData("itemIdOver", currentMouseOverKey);
+
+ if (currentMouseOverKey != null) {
+ String detail = getDropDetail(drag.getCurrentGwtEvent());
+ Boolean overTreeNode = null;
+ if (!keyToNode.get(currentMouseOverKey).isLeaf()
+ && "Center".equals(detail)) {
+ overTreeNode = true;
+ }
+ drag.getTransferrable().setData("itemIdOverIsNode", overTreeNode);
+
+ drag.getTransferrable().setData("detail", detail);
+
+ }
+ }
+
+ private void updateDropHandler(UIDL childUidl) {
+ if (dropHandler == null) {
+ dropHandler = new AbstractDropHandler() {
+
+ @Override
+ public void dragEnter(DragEvent drag) {
+ updateTreeRelatedTransferData(drag);
+ super.dragEnter(drag);
+ }
+
+ @Override
+ protected void dragAccepted(final DragEvent drag) {
+ }
+
+ @Override
+ public void dragOver(final DragEvent currentDrag) {
+ final Object oldIdOver = currentDrag.getTransferrable()
+ .getData("itemIdOver");
+ final String oldDetail = (String) currentDrag
+ .getTransferrable().getData("detail");
+ /*
+ * Using deferred command, so event bubbles to TreeNode
+ * event listener. Currently here via preview
+ */
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ final String detail = getDropDetail(currentDrag
+ .getCurrentGwtEvent());
+ boolean nodeHasChanged = (currentMouseOverKey != null && currentMouseOverKey != oldIdOver)
+ || (oldIdOver != null);
+ boolean detailHasChanded = !detail
+ .equals(oldIdOver);
+
+ if (nodeHasChanged || detailHasChanded) {
+ ApplicationConnection.getConsole().log(
+ "Change in Transferable "
+ + currentMouseOverKey + " "
+ + detail);
+
+ updateTreeRelatedTransferData(currentDrag);
+ AcceptCallback accpectedCb = new AcceptCallback() {
+ public void handleResponse(
+ ValueMap responseData) {
+ if (responseData == null // via client
+ // side
+ // validation
+ || responseData
+ .containsKey("accepted")) {
+ keyToNode.get(currentMouseOverKey)
+ .emphasis(detail);
+ }
+ }
+ };
+ if (validateOnServer()) {
+ DragAndDropManager.get().visitServer(
+ DragEventType.OVER, accpectedCb);
+
+ } else {
+ if (validates(currentDrag
+ .getTransferrable())) {
+ accpectedCb.handleResponse(null);
+ } else {
+ keyToNode.get(currentMouseOverKey)
+ .emphasis(null);
+ }
+ if (oldIdOver != null
+ && oldIdOver != currentMouseOverKey) {
+ keyToNode.get(oldIdOver).emphasis(null);
+ }
+ }
+ }
+
+ }
+ });
+ }
+
+ @Override
+ public void dragLeave(DragEvent drag) {
+ cleanUp();
+ }
+
+ private void cleanUp() {
+ if (currentMouseOverKey != null) {
+ keyToNode.get(currentMouseOverKey).emphasis(null);
+ currentMouseOverKey = null;
+ }
+ }
+
+ @Override
+ public boolean drop(DragEvent drag) {
+ cleanUp();
+ return super.drop(drag);
+ }
+
+ @Override
+ public Paintable getPaintable() {
+ return VTree.this;
+ }
+
+ public ApplicationConnection getApplicationConnection() {
+ return client;
+ }
+
+ };
+ }
+ dropHandler.updateRules(childUidl);
+ }
+
+ public String getDropDetail(NativeEvent event) {
+ TreeNode treeNode = keyToNode.get(currentMouseOverKey);
+ // TODO no scroll support
+ int offsetHeight = treeNode.nodeCaptionDiv.getOffsetHeight();
+ int absoluteTop = treeNode.getAbsoluteTop();
+ int clientY = event.getClientY();
+ int fromTop = clientY - absoluteTop;
+
+ String detail;
+ float percentageFromTop = (fromTop / (float) offsetHeight);
+ if (percentageFromTop < 0.2) {
+ detail = "Top";
+ } else if (percentageFromTop > 0.8) {
+ detail = "Bottom";
+ } else {
+ detail = "Center";
+ }
+
+ return detail;
+
+ }
+
private void handleUpdate(UIDL uidl) {
final TreeNode rootNode = keyToNode.get(uidl
.getStringAttribute("rootKey"));
@@ -204,12 +376,27 @@ public class VTree extends FlowPanel implements Paintable {
private Element ie6compatnode;
+ private Event mouseDownEvent;
+
public TreeNode() {
constructDom();
- sinkEvents(Event.ONCLICK | Event.ONDBLCLICK | Event.ONMOUSEUP
+ sinkEvents(Event.ONCLICK | Event.ONDBLCLICK | Event.MOUSEEVENTS
| Event.ONCONTEXTMENU);
}
+ public void emphasis(String string) {
+ // ApplicationConnection.getConsole().log("OUTLINE" + string);
+ Style style = nodeCaptionDiv.getStyle();
+ String top = "Top".equals(string) ? "2px solid green" : null;
+ String bottom = "Bottom".equals(string) ? "2px solid green" : null;
+ String bg = "Center".equals(string) ? "green" : null;
+
+ style.setProperty("borderTop", top);
+ style.setProperty("borderBottom", bottom);
+ style.setBackgroundColor(bg);
+
+ }
+
@Override
public void onBrowserEvent(Event event) {
super.onBrowserEvent(event);
@@ -235,6 +422,45 @@ public class VTree extends FlowPanel implements Paintable {
} else if (type == Event.ONCONTEXTMENU) {
showContextMenu(event);
}
+
+ if (dragModes != 0 || dropHandler != null) {
+ if (type == Event.ONMOUSEDOWN) {
+ if (nodeCaptionDiv.isOrHasChild(event.getTarget())) {
+ ApplicationConnection.getConsole().log(
+ "TreeNode m down");
+ event.preventDefault(); // prevent text selection
+ mouseDownEvent = event;
+ }
+ } else if (type == Event.ONMOUSEMOVE
+ || type == Event.ONMOUSEOUT) {
+
+ if (mouseDownEvent != null) {
+ ApplicationConnection.getConsole().log(
+ "TreeNode drag start " + event.getType());
+ // start actual drag on slight move when mouse is down
+ Transferable t = new Transferable();
+ t.setComponent(VTree.this);
+ t.setItemId(key);
+ DragEvent drag = DragAndDropManager.get().startDrag(t,
+ mouseDownEvent, true);
+ Element node = (Element) nodeCaptionDiv.cloneNode(true);
+ node.getStyle().setOpacity(0.4);
+ node.getStyle().setBackgroundColor("#999");
+ drag.setDragImage(node);
+ event.stopPropagation();
+
+ mouseDownEvent = null;
+ }
+ } else if (type == Event.ONMOUSEUP) {
+ mouseDownEvent = null;
+ }
+ if (type == Event.ONMOUSEOVER) {
+ mouseDownEvent = null;
+ currentMouseOverKey = key;
+ event.stopPropagation();
+ }
+
+ }
}
private void fireClick(Event evt) {
@@ -344,6 +570,10 @@ public class VTree extends FlowPanel implements Paintable {
}
}
+ public boolean isLeaf() {
+ return getStyleName().contains("leaf");
+ }
+
private void setState(boolean state, boolean notifyServer) {
if (open == state) {
return;
@@ -484,4 +714,8 @@ public class VTree extends FlowPanel implements Paintable {
}
}
}
+
+ public DropHandler getDropHandler() {
+ return dropHandler;
+ }
}
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
index 2bc10b4cc0..d6fa230f3c 100644
--- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
+++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java
@@ -316,6 +316,8 @@ public abstract class AbstractCommunicationManager implements
private int timeoutInterval = -1;
+ private DragAndDropService dragAndDropService;
+
/**
* TODO New constructor - document me!
*
@@ -939,6 +941,10 @@ public abstract class AbstractCommunicationManager implements
// add any pending locale definitions requested by the client
printLocaleDeclarations(outWriter);
+ if (dragAndDropService != null) {
+ dragAndDropService.printJSONResponse(outWriter);
+ }
+
outWriter.print("}]");
}
outWriter.flush();
@@ -1006,8 +1012,7 @@ public abstract class AbstractCommunicationManager implements
if (i + 1 < variableRecords.length) {
nextVariable = variableRecords[i + 1];
}
- final VariableOwner owner = (VariableOwner) idPaintableMap
- .get(variable[VAR_PID]);
+ final VariableOwner owner = getVariableOwner(variable[VAR_PID]);
if (owner != null && owner.isEnabled()) {
// TODO this should be Map<String, Object>, but the
// VariableOwner API does not guarantee the key is a
@@ -1058,8 +1063,13 @@ public abstract class AbstractCommunicationManager implements
}
}
} catch (Exception e) {
- handleChangeVariablesError(application2,
- (Component) owner, e, m);
+ if (owner instanceof Component) {
+ handleChangeVariablesError(application2,
+ (Component) owner, e, m);
+ } else {
+ // TODO DragDropService error handling
+ throw new RuntimeException(e);
+ }
}
} else {
@@ -1112,6 +1122,21 @@ public abstract class AbstractCommunicationManager implements
return success;
}
+ private VariableOwner getVariableOwner(String string) {
+ VariableOwner owner = (VariableOwner) idPaintableMap.get(string);
+ if (owner == null && string.startsWith("DD")) {
+ return getDragAndDropService();
+ }
+ return owner;
+ }
+
+ private VariableOwner getDragAndDropService() {
+ if (dragAndDropService == null) {
+ dragAndDropService = new DragAndDropService();
+ }
+ return dragAndDropService;
+ }
+
/**
* Reads the request data from the Request and returns it converted to an
* UTF-8 string.
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java
index 406ee9072d..e8a6ae5a9d 100644
--- a/src/com/vaadin/ui/AbsoluteLayout.java
+++ b/src/com/vaadin/ui/AbsoluteLayout.java
@@ -50,6 +50,7 @@ public class AbsoluteLayout extends AbstractLayout {
public void addComponent(Component c) {
components.add(c);
super.addComponent(c);
+ requestRepaint();
}
@Override
diff --git a/src/com/vaadin/ui/CustomLayout.java b/src/com/vaadin/ui/CustomLayout.java
index 26495a3715..0baa0dd468 100644
--- a/src/com/vaadin/ui/CustomLayout.java
+++ b/src/com/vaadin/ui/CustomLayout.java
@@ -1,4 +1,4 @@
-/*
+/*
@ITMillApache2LicenseForJavaFiles@
*/
@@ -37,8 +37,6 @@ import com.vaadin.terminal.gwt.client.ui.VCustomLayout;
* </p>
*
* @author IT Mill Ltd.
- * @author Duy B. Vo (<a
- * href="mailto:devduy@gmail.com?subject=Vaadin">devduy@gmail.com</a>)
* @version
* @VERSION@
* @since 3.0
@@ -59,14 +57,6 @@ public class CustomLayout extends AbstractLayout {
private String templateName = null;
/**
- * Default constructor only used by subclasses because the subclasses are
- * responsible for setting the appropriate fields.
- */
- protected CustomLayout() {
- setWidth(100, UNITS_PERCENTAGE);
- }
-
- /**
* Constructs a custom layout with the template given in the stream.
*
* @param templateStream
@@ -78,24 +68,10 @@ public class CustomLayout extends AbstractLayout {
* @throws IOException
*/
public CustomLayout(InputStream templateStream) throws IOException {
- this();
- initTemplateContentsFromInputStream(templateStream);
- }
-
- /**
- * Constructor for custom layout with given template name. Template file is
- * fetched from "<theme>/layout/<templateName>".
- */
- public CustomLayout(String template) {
- this();
- templateName = template;
- }
- protected void initTemplateContentsFromInputStream(
- InputStream templateStream) throws IOException {
InputStreamReader reader = new InputStreamReader(templateStream,
"UTF-8");
- StringBuilder b = new StringBuilder(BUFFER_SIZE);
+ StringBuffer b = new StringBuffer(BUFFER_SIZE);
char[] cbuf = new char[BUFFER_SIZE];
int offset = 0;
@@ -109,6 +85,16 @@ public class CustomLayout extends AbstractLayout {
}
templateContents = b.toString();
+ setWidth(100, UNITS_PERCENTAGE);
+ }
+
+ /**
+ * Constructor for custom layout with given template name. Template file is
+ * fetched from "<theme>/layout/<templateName>".
+ */
+ public CustomLayout(String template) {
+ templateName = template;
+ setWidth(100, UNITS_PERCENTAGE);
}
/**
@@ -260,9 +246,7 @@ public class CustomLayout extends AbstractLayout {
*
* @param name
* template name
- * @deprecated Use {@link #setTemplateName(String)} instead
*/
- @Deprecated
@Override
public void setStyle(String name) {
setTemplateName(name);
@@ -273,11 +257,6 @@ public class CustomLayout extends AbstractLayout {
return templateName;
}
- /** Get the contents of the template */
- public String getTemplateContents() {
- return templateContents;
- }
-
/**
* Set the name of the template used to draw custom layout.
*
@@ -294,17 +273,6 @@ public class CustomLayout extends AbstractLayout {
}
/**
- * Set the contents of the template used to draw the custom layout.
- *
- * @param templateContents
- */
- public void setTemplateContents(String templateContents) {
- this.templateContents = templateContents;
- templateName = null;
- requestRepaint();
- }
-
- /**
* Although most layouts support margins, CustomLayout does not. The
* behaviour of this layout is determined almost completely by the actual
* template.
diff --git a/src/com/vaadin/ui/Select.java b/src/com/vaadin/ui/Select.java
index e8e0dfebaa..4174001d87 100644
--- a/src/com/vaadin/ui/Select.java
+++ b/src/com/vaadin/ui/Select.java
@@ -234,6 +234,12 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering,
currentPage = -1; // current page is always set by client
optionRequest = true;
+
+ // Hide the error indicator if needed
+ if (isRequired() && isEmpty() && getComponentError() == null
+ && getErrorMessage() != null) {
+ target.addAttribute("hideErrors", true);
+ }
}
/**
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java
index 0563756d40..5b99f614f1 100644
--- a/src/com/vaadin/ui/Table.java
+++ b/src/com/vaadin/ui/Table.java
@@ -23,7 +23,9 @@ import com.vaadin.data.Property;
import com.vaadin.data.util.ContainerOrderedWrapper;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.event.Action;
+import com.vaadin.event.DataBindedTransferrable;
import com.vaadin.event.ItemClickEvent;
+import com.vaadin.event.Transferable;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.event.ItemClickEvent.ItemClickSource;
@@ -31,6 +33,7 @@ import com.vaadin.terminal.KeyMapper;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.TransferTranslator;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.VScrollTable;
@@ -54,7 +57,15 @@ import com.vaadin.terminal.gwt.client.ui.VScrollTable;
@SuppressWarnings("serial")
@ClientWidget(VScrollTable.class)
public class Table extends AbstractSelect implements Action.Container,
- Container.Ordered, Container.Sortable, ItemClickSource {
+ Container.Ordered, Container.Sortable, ItemClickSource,
+ TransferTranslator {
+
+ /**
+ * Modes that Table support as drag sourse.
+ */
+ public enum DragModes {
+ NONE, ROWS, CELLS
+ }
private static final int CELL_KEY = 0;
@@ -327,6 +338,8 @@ public class Table extends AbstractSelect implements Action.Container,
private double cacheRate = CACHE_RATE_DEFAULT;
+ private DragModes dragMode = DragModes.NONE;
+
/* Table constructors */
/**
@@ -2014,6 +2027,10 @@ public class Table extends AbstractSelect implements Action.Container,
target.addAttribute("tabindex", getTabIndex());
}
+ if (dragMode != DragModes.NONE) {
+ target.addAttribute("dragmode", dragMode.ordinal());
+ }
+
// Initialize temps
final Object[] colids = getVisibleColumns();
final int cols = colids.length;
@@ -3299,4 +3316,61 @@ public class Table extends AbstractSelect implements Action.Container,
}
}
}
+
+ public void setDragMode(DragModes newDragMode) {
+ dragMode = newDragMode;
+ requestRepaint();
+ }
+
+ class TableTransferrable implements DataBindedTransferrable {
+
+ private final HashMap<String, Object> data = new HashMap<String, Object>();
+
+ public Object getItemId() {
+ return data.get("itemId");
+ }
+
+ public Object getPropertyId() {
+ return getItemCaptionPropertyId();
+ }
+
+ public Component getSourceComponent() {
+ return Table.this;
+ }
+
+ public Object getData(String dataFlawor) {
+ return data.get(dataFlawor);
+ }
+
+ public Collection<String> getDataFlawors() {
+ return data.keySet();
+ }
+
+ public void setData(String dataFlawor, Object value) {
+ data.put(dataFlawor, value);
+ }
+
+ }
+
+ private void updateTransferrable(Map<String, Object> rawVariables,
+ Transferable tr, boolean isDropTarget) {
+ Map<String, Object> payload = (Map<String, Object>) rawVariables
+ .get("payload");
+ if (!isDropTarget) {
+ Object object = payload.get("itemId");
+ if (object != null) {
+ tr.setData("itemId", itemIdMapper.get((String) object));
+ payload.remove("itemId");
+ }
+ }
+ }
+
+ public Transferable getTransferrable(Transferable transferable,
+ Map<String, Object> rawVariables, boolean isDropTarget) {
+ if (transferable == null) {
+ transferable = new TableTransferrable();
+ }
+ updateTransferrable(rawVariables, transferable, isDropTarget);
+ return transferable;
+ }
}
diff --git a/src/com/vaadin/ui/Tree.java b/src/com/vaadin/ui/Tree.java
index 28a410fa13..8e5cd8aca7 100644
--- a/src/com/vaadin/ui/Tree.java
+++ b/src/com/vaadin/ui/Tree.java
@@ -22,14 +22,20 @@ import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.util.ContainerHierarchicalWrapper;
import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.event.AbstractDropHandler;
import com.vaadin.event.Action;
+import com.vaadin.event.DataBindedTransferrable;
+import com.vaadin.event.DropHandler;
+import com.vaadin.event.HasDropHandler;
import com.vaadin.event.ItemClickEvent;
+import com.vaadin.event.Transferable;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.event.ItemClickEvent.ItemClickSource;
import com.vaadin.terminal.KeyMapper;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.TransferTranslator;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.terminal.gwt.client.ui.VTree;
@@ -45,7 +51,7 @@ import com.vaadin.terminal.gwt.client.ui.VTree;
@SuppressWarnings("serial")
@ClientWidget(VTree.class)
public class Tree extends AbstractSelect implements Container.Hierarchical,
- Action.Container, ItemClickSource {
+ Action.Container, ItemClickSource, TransferTranslator, HasDropHandler {
private static final Method EXPAND_METHOD;
@@ -102,6 +108,68 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
*/
private boolean initialPaint = true;
+ // TODO sort DD members and methods
+ public static int DRAG_SORTABLE = 1;
+ public static int DRAG_OUT = 2;
+ public static int DRAG_NONE = 0;
+
+ private int itemDragModes = DRAG_OUT;
+
+ class TreeTransferrable implements DataBindedTransferrable {
+
+ private final HashMap<String, Object> data = new HashMap<String, Object>();
+
+ public Object getItemId() {
+ return data.get("itemId");
+ }
+
+ public Object getPropertyId() {
+ return getItemCaptionPropertyId();
+ }
+
+ public Component getSourceComponent() {
+ return Tree.this;
+ }
+
+ public Object getData(String dataFlawor) {
+ return data.get(dataFlawor);
+ }
+
+ public Collection<String> getDataFlawors() {
+ return data.keySet();
+ }
+
+ public void setData(String dataFlawor, Object value) {
+ data.put(dataFlawor, value);
+ }
+ }
+
+ public Transferable getTransferrable(Transferable transferable,
+ Map<String, Object> rawVariables, boolean isDropTarget) {
+ if (transferable == null) {
+ transferable = new TreeTransferrable();
+ }
+ Map<String, Object> payload = (Map<String, Object>) rawVariables
+ .get("payload");
+ if (isDropTarget) {
+ // updating drag target variables
+ Object object = payload.get("itemIdOver");
+ Object object2 = itemIdMapper.get((String) object);
+ transferable.setData("itemIdOver", object2);
+ payload.remove("itemIdOver");
+ } else {
+ // updating drag source variables
+ Object object = payload.get("itemId");
+ if (object != null) {
+ transferable.setData("itemId", itemIdMapper
+ .get((String) object));
+ }
+ payload.remove("itemId");
+ }
+
+ return transferable;
+ }
+
/* Tree constructors */
/**
@@ -435,6 +503,10 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
target.addAttribute("nullselect", true);
}
+ if (itemDragModes != 0) {
+ target.addAttribute("dragModes", itemDragModes);
+ }
+
}
// Initialize variables
@@ -579,6 +651,11 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
// New items
target.addVariable(this, "newitem", new String[] {});
+
+ if (abstractDropHandler != null) {
+ abstractDropHandler.paint(target);
+ }
+
}
}
@@ -1019,6 +1096,8 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
private ItemStyleGenerator itemStyleGenerator;
+ private AbstractDropHandler abstractDropHandler;
+
public void addListener(ItemClickListener listener) {
addListener(VTree.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener,
ItemClickEvent.ITEM_CLICK_METHOD);
@@ -1075,4 +1154,12 @@ public class Tree extends AbstractSelect implements Container.Hierarchical,
return super.removeItem(itemId);
}
+ public DropHandler getDropHandler() {
+ return abstractDropHandler;
+ }
+
+ public void setDropHandler(AbstractDropHandler abstractDropHandler) {
+ this.abstractDropHandler = abstractDropHandler;
+ }
+
}
diff --git a/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html
index 40e27920a8..ef2c784e15 100644
--- a/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html
+++ b/tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html
@@ -22,11 +22,6 @@
<td></td>
</tr>
<tr>
- <td>focus</td>
- <td>vaadin=runcomvaadintestscomponentsabstractfieldAbstractFieldCommitWithInvalidValues::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextField[0]</td>
- <td></td>
-</tr>
-<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentsabstractfieldAbstractFieldCommitWithInvalidValues::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]</td>
<td></td>
diff --git a/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html b/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html
index 0d5b435609..b0305e60dc 100644
--- a/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html
+++ b/tests/src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html
@@ -22,11 +22,6 @@
<td></td>
</tr>
<tr>
- <td>focus</td>
- <td>vaadin=runcomvaadintestscomponentsformFormCommitWithInvalidValues::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentsformFormCommitWithInvalidValues::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]</td>
<td></td>
diff --git a/tests/src/com/vaadin/tests/layouts/GridLayoutNPE.java b/tests/src/com/vaadin/tests/layouts/GridLayoutNPE.java
new file mode 100644
index 0000000000..5f67aa1a57
--- /dev/null
+++ b/tests/src/com/vaadin/tests/layouts/GridLayoutNPE.java
@@ -0,0 +1,72 @@
+package com.vaadin.tests.layouts;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Button.ClickEvent;
+
+public class GridLayoutNPE extends TestBase {
+
+ @Override
+ protected void setup() {
+ final VerticalLayout lo = new VerticalLayout();
+
+ final GridLayout gl = new GridLayout(2, 1);
+ gl.setSpacing(true);
+
+ final Label toRemove = new Label("First");
+ gl.addComponent(toRemove);
+ final Label toEdit = new Label("Second");
+ gl.addComponent(toEdit);
+
+ final Button b = new Button("remove 'First'");
+ final Button b2 = new Button("edit 'Second'");
+ b2.setVisible(false);
+
+ lo.addComponent(gl);
+ lo.addComponent(b);
+ lo.addComponent(b2);
+
+ b.addListener(new Button.ClickListener() {
+
+ public void buttonClick(Button.ClickEvent event) {
+ gl.removeComponent(toRemove);
+
+ // move another component to where the first was removed
+ // before rendering to the client
+ gl.removeComponent(toEdit);
+ // this could also be the result of removeAllComponents()
+ // followed by a loop of addComponent(c)
+ gl.addComponent(toEdit, 0, 0);
+
+ b.setVisible(false);
+ b2.setVisible(true);
+
+ }
+
+ });
+
+ b2.addListener(new Button.ClickListener() {
+
+ public void buttonClick(ClickEvent event) {
+ toEdit.setValue("Second (edited)");
+ }
+
+ });
+
+ addComponent(lo);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "VGridLayout throws an NPE, causing client side to crash";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 4019;
+ }
+
+}
diff --git a/tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.html b/tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.html
deleted file mode 100644
index 3d5f70f994..0000000000
--- a/tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.html
+++ /dev/null
@@ -1,402 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="http://localhost:8080/run/com.vaadin.tests.validation.EmptyFieldErrorIndicators?restartApplication" />
-<title>EmptyFieldErrorIndicators</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">EmptyFieldErrorIndicators</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.validation.EmptyFieldErrorIndicators?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>initial</td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VDateFieldCalendar[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[4]</td>
- <td>168</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>emptyValidated</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
- <td>22,15</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
- <td>a</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[0]/domChild[1]</td>
- <td>15,10</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[3]</td>
- <td>312</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[3]/td[1]/span</td>
- <td>12,8</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[4]</td>
- <td>5980</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VDateFieldCalendar[0]/domChild[0]/domChild[1]/domChild[1]/domChild[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]</td>
- <td>17,11</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VDateFieldCalendar[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>6496</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[1]/domChild[1]</td>
- <td>11,12</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[3]</td>
- <td>364</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[3]/td[1]/span</td>
- <td>19,9</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[4]</td>
- <td>9919</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VFilterSelect[1]/domChild[1]</td>
- <td>11,11</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[2]/table/tbody/tr[2]/td</td>
- <td>55,0</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VOptionGroup[0]/domChild[0]/domChild[0]</td>
- <td>9,3</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VOptionGroup[1]/domChild[0]/domChild[0]</td>
- <td>11,7</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
- <td>32,14</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[0]</td>
- <td>a</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[0]/domChild[1]</td>
- <td>12,9</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[3]</td>
- <td>520</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[3]/td[1]/span</td>
- <td>12,12</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[4]</td>
- <td>689</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VDateFieldCalendar[0]/domChild[0]/domChild[1]/domChild[1]/domChild[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]</td>
- <td>19,15</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VDateFieldCalendar[0]/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>798</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[1]/domChild[1]</td>
- <td>11,15</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[2]</td>
- <td>91</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[2]/td/table/tbody/tr[3]/td[1]/span</td>
- <td>22,12</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>scroll</td>
- <td>//table[@id='PID_VAADIN_POPUPCAL']/tbody/tr[3]/td/div/select[4]</td>
- <td>4303</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VFilterSelect[1]/domChild[1]</td>
- <td>9,13</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>//div[@id='VAADIN_COMBOBOX_OPTIONLIST']/div/div[2]/table/tbody/tr[2]/td/span</td>
- <td>23,9</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VOptionGroup[0]/domChild[0]/domChild[0]</td>
- <td>5,6</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VOptionGroup[1]/domChild[0]/domChild[0]</td>
- <td>7,7</td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsvalidationEmptyFieldErrorIndicators::PID_SvalidatedFieldPart/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>filledValidated</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java b/tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
deleted file mode 100644
index 9ea28f672e..0000000000
--- a/tests/src/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
+++ /dev/null
@@ -1,136 +0,0 @@
-package com.vaadin.tests.validation;
-
-import com.vaadin.data.Validator.InvalidValueException;
-import com.vaadin.data.validator.AbstractValidator;
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.ComponentContainer;
-import com.vaadin.ui.DateField;
-import com.vaadin.ui.Field;
-import com.vaadin.ui.Form;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.InlineDateField;
-import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.OptionGroup;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.PopupDateField;
-import com.vaadin.ui.Select;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-
-public class EmptyFieldErrorIndicators extends TestBase {
-
- @Override
- protected void setup() {
- getLayout().setSizeFull();
-
- HorizontalLayout hl = new HorizontalLayout();
- hl.setSizeFull();
- hl.setSpacing(true);
-
- ComponentContainer part1 = createPart(
- "Empty required fields validation", true, false);
- part1.setDebugId("emptyFieldPart");
- hl.addComponent(part1);
-
- ComponentContainer part2 = createPart(
- "Empty required fields with failing validator", true, true);
- part1.setDebugId("validatedFieldPart");
- hl.addComponent(part2);
-
- Panel panel = new Panel();
- panel.setSizeFull();
- panel.setStyleName(Panel.STYLE_LIGHT);
- panel.addComponent(hl);
- panel.setScrollable(true);
- addComponent(panel);
- }
-
- private ComponentContainer createPart(String caption, boolean required,
- boolean failValidator) {
- VerticalLayout part = new VerticalLayout();
- part.setMargin(true);
-
- final Form form = createForm(required, failValidator);
- part.addComponent(form);
-
- Button validate = new Button("Validate fields");
- validate.addListener(new ClickListener() {
- public void buttonClick(ClickEvent event) {
- try {
- form.validate();
- } catch (InvalidValueException e) {
- }
- }
- });
- part.addComponent(validate);
-
- Panel panel = new Panel(caption, part);
- panel.setHeight("100%");
- return panel;
- }
-
- private Form createForm(final boolean required, final boolean failValidator) {
- // hand-crafted form, not using form field factory
- Form form = new Form() {
- @Override
- public void addField(Object propertyId, Field field) {
- super.addField(propertyId, field);
- field.setRequired(required);
- field.setRequiredError("Missing required value!");
- if (failValidator) {
- field
- .addValidator(new AbstractValidator(
- "Validation error") {
- public boolean isValid(Object value) {
- return false;
- }
- });
- }
- }
- };
-
- form.addField("Field", new TextField("Text"));
- form.addField("Date", new DateField("Date"));
- form.addField("Inline Date", new InlineDateField("Date"));
- form.addField("Popup Date", new PopupDateField("Date"));
-
- form.addField("Native Select", new NativeSelect("NativeSelect"));
-
- // in #4103, the Select component was behaving differently from others
- form.addField("Select", new Select("Select"));
-
- Select select2 = new Select("Select 2");
- select2.addItem("Value 1");
- form.addField("Select 2", select2);
-
- OptionGroup optionGroup = new OptionGroup("OptionGroup");
- optionGroup.setMultiSelect(false);
- optionGroup.addItem("Option 1");
- optionGroup.addItem("Option 2");
- form.addField("Option Group 1", optionGroup);
-
- OptionGroup optionGroup2 = new OptionGroup("OptionGroup");
- optionGroup2.setMultiSelect(true);
- optionGroup2.addItem("Option 1");
- optionGroup2.addItem("Option 2");
- form.addField("Option Group 2", optionGroup2);
-
- // TODO could add more different fields
-
- return form;
- }
-
- @Override
- protected String getDescription() {
- return "Fields on a form should not show the error indicator if required and empty";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 4013;
- }
-
-}