From 556730ab5ae0daefbbc2e077463c68d2081eaec3 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 25 Jun 2012 11:47:49 +0000 Subject: #8957 Ensure non-negative width svn changeset:23973/svn branch:6.8 --- .../vaadin/terminal/gwt/client/ui/VScrollTable.java | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java index 24097c0949..fa7621e512 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java @@ -3500,20 +3500,15 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, DOM.setStyleAttribute(captionContainer, "width", ""); setWidth(""); } else { - /* * Reduce width with one pixel for the right border since the * footers does not have any spacers between them. */ - int borderWidths = 1; + final int borderWidths = 1; // Set the container width (check for negative value) - if (w - borderWidths >= 0) { - captionContainer.getStyle().setPropertyPx("width", - w - borderWidths); - } else { - captionContainer.getStyle().setPropertyPx("width", 0); - } + captionContainer.getStyle().setPropertyPx("width", + Math.max(w - borderWidths, 0)); /* * if we already have tBody, set the header width properly, if @@ -3521,21 +3516,16 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler, * unless TD width is not explicitly set. */ if (scrollBody != null) { - /* - * Reduce with one since footer does not have any spacers, - * instead a 1 pixel border. - */ int tdWidth = width + scrollBody.getCellExtraWidth() - borderWidths; - setWidth(tdWidth + "px"); + setWidth(Math.max(tdWidth, 0) + "px"); } else { Scheduler.get().scheduleDeferred(new Command() { public void execute() { - int borderWidths = 1; int tdWidth = width + scrollBody.getCellExtraWidth() - borderWidths; - setWidth(tdWidth + "px"); + setWidth(Math.max(tdWidth, 0) + "px"); } }); } -- cgit v1.2.3 From aa98b6f5438b5726cccce945e468d457c7a969a4 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 26 Jun 2012 14:56:31 +0300 Subject: Move test component out of main source folder --- .../HelloWorldExtensionConnector.java | 2 +- src/com/vaadin/ui/HelloWorldExtension.java | 38 --------------------- .../tests/extensions/HelloWorldExtension.java | 39 ++++++++++++++++++++++ .../tests/extensions/HelloWorldExtensionTest.java | 1 - 4 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 src/com/vaadin/ui/HelloWorldExtension.java create mode 100644 tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java index ff444fece5..7185397f94 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java @@ -10,7 +10,7 @@ import com.vaadin.terminal.gwt.client.VConsole; import com.vaadin.terminal.gwt.client.communication.RpcProxy; import com.vaadin.terminal.gwt.client.ui.AbstractConnector; import com.vaadin.terminal.gwt.client.ui.Connect; -import com.vaadin.ui.HelloWorldExtension; +import com.vaadin.tests.extensions.HelloWorldExtension; @Connect(HelloWorldExtension.class) public class HelloWorldExtensionConnector extends AbstractConnector { diff --git a/src/com/vaadin/ui/HelloWorldExtension.java b/src/com/vaadin/ui/HelloWorldExtension.java deleted file mode 100644 index e705954f2e..0000000000 --- a/src/com/vaadin/ui/HelloWorldExtension.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.ui; - -import com.vaadin.terminal.AbstractExtension; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.GreetAgainRpc; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldRpc; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldState; - -public class HelloWorldExtension extends AbstractExtension { - - public HelloWorldExtension() { - registerRpc(new HelloWorldRpc() { - public void onMessageSent(String message) { - Notification.show(message); - } - }); - } - - @Override - public HelloWorldState getState() { - return (HelloWorldState) super.getState(); - } - - public void setGreeting(String greeting) { - getState().setGreeting(greeting); - requestRepaint(); - } - - public String getGreeting() { - return getState().getGreeting(); - } - - public void greetAgain() { - getRpcProxy(GreetAgainRpc.class).greetAgain(); - } -} diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java new file mode 100644 index 0000000000..d0f0994af3 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java @@ -0,0 +1,39 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.extensions; + +import com.vaadin.terminal.AbstractExtension; +import com.vaadin.terminal.gwt.client.ui.helloworldfeature.GreetAgainRpc; +import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldRpc; +import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldState; +import com.vaadin.ui.Notification; + +public class HelloWorldExtension extends AbstractExtension { + + public HelloWorldExtension() { + registerRpc(new HelloWorldRpc() { + public void onMessageSent(String message) { + Notification.show(message); + } + }); + } + + @Override + public HelloWorldState getState() { + return (HelloWorldState) super.getState(); + } + + public void setGreeting(String greeting) { + getState().setGreeting(greeting); + requestRepaint(); + } + + public String getGreeting() { + return getState().getGreeting(); + } + + public void greetAgain() { + getRpcProxy(GreetAgainRpc.class).greetAgain(); + } +} diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java index b56e05b2a0..1671673198 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java @@ -7,7 +7,6 @@ import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestRoot; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.HelloWorldExtension; public class HelloWorldExtensionTest extends AbstractTestRoot { -- cgit v1.2.3 From 399b4cb789f4d898e84dfb386b8ad45af5cee7d5 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 26 Jun 2012 15:25:28 +0300 Subject: Move test extension out of main source folder --- .../client/ui/helloworldfeature/GreetAgainRpc.java | 12 ------ .../HelloWorldExtensionConnector.java | 48 ---------------------- .../client/ui/helloworldfeature/HelloWorldRpc.java | 10 ----- .../ui/helloworldfeature/HelloWorldState.java | 18 -------- .../tests/extensions/HelloWorldExtension.java | 6 +-- .../tests/extensions/HelloWorldExtensionTest.java | 2 + .../client/helloworldfeature/GreetAgainRpc.java | 12 ++++++ .../HelloWorldExtensionConnector.java | 48 ++++++++++++++++++++++ .../client/helloworldfeature/HelloWorldRpc.java | 10 +++++ .../client/helloworldfeature/HelloWorldState.java | 18 ++++++++ 10 files changed, 93 insertions(+), 91 deletions(-) delete mode 100644 src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/GreetAgainRpc.java delete mode 100644 src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java delete mode 100644 src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldRpc.java delete mode 100644 src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldState.java create mode 100644 tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java create mode 100644 tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java create mode 100644 tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java create mode 100644 tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/GreetAgainRpc.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/GreetAgainRpc.java deleted file mode 100644 index 0bfb8f3c32..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/GreetAgainRpc.java +++ /dev/null @@ -1,12 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.vaadin.terminal.gwt.client.communication.ClientRpc; - -public interface GreetAgainRpc extends ClientRpc { - - public void greetAgain(); - -} diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java deleted file mode 100644 index 7185397f94..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldExtensionConnector.java +++ /dev/null @@ -1,48 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.google.gwt.user.client.Window; -import com.vaadin.terminal.gwt.client.ServerConnector; -import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VConsole; -import com.vaadin.terminal.gwt.client.communication.RpcProxy; -import com.vaadin.terminal.gwt.client.ui.AbstractConnector; -import com.vaadin.terminal.gwt.client.ui.Connect; -import com.vaadin.tests.extensions.HelloWorldExtension; - -@Connect(HelloWorldExtension.class) -public class HelloWorldExtensionConnector extends AbstractConnector { - HelloWorldRpc rpc = RpcProxy.create(HelloWorldRpc.class, this); - - @Override - public HelloWorldState getState() { - return (HelloWorldState) super.getState(); - } - - @Override - protected void init() { - registerRpc(GreetAgainRpc.class, new GreetAgainRpc() { - public void greetAgain() { - greet(); - } - }); - } - - @Override - public void setParent(ServerConnector parent) { - super.setParent(parent); - greet(); - } - - private void greet() { - String msg = getState().getGreeting() + " from " - + Util.getConnectorString(this) + " attached to " - + Util.getConnectorString(getParent()); - VConsole.log(msg); - - String response = Window.prompt(msg, ""); - rpc.onMessageSent(response); - } -} diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldRpc.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldRpc.java deleted file mode 100644 index 0289713390..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldRpc.java +++ /dev/null @@ -1,10 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.vaadin.terminal.gwt.client.communication.ServerRpc; - -public interface HelloWorldRpc extends ServerRpc { - public void onMessageSent(String message); -} diff --git a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldState.java b/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldState.java deleted file mode 100644 index 9524a5e9aa..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/helloworldfeature/HelloWorldState.java +++ /dev/null @@ -1,18 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.helloworldfeature; - -import com.vaadin.terminal.gwt.client.communication.SharedState; - -public class HelloWorldState extends SharedState { - private String greeting = "Hello world"; - - public String getGreeting() { - return greeting; - } - - public void setGreeting(String greeting) { - this.greeting = greeting; - } -} diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java index d0f0994af3..23b892be66 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java @@ -4,9 +4,9 @@ package com.vaadin.tests.extensions; import com.vaadin.terminal.AbstractExtension; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.GreetAgainRpc; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldRpc; -import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldState; +import com.vaadin.tests.widgetset.client.helloworldfeature.GreetAgainRpc; +import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldRpc; +import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldState; import com.vaadin.ui.Notification; public class HelloWorldExtension extends AbstractExtension { diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java index 1671673198..8625ffd955 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java @@ -3,11 +3,13 @@ */ package com.vaadin.tests.extensions; +import com.vaadin.annotations.Widgetset; import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestRoot; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; +@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet") public class HelloWorldExtensionTest extends AbstractTestRoot { @Override diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java new file mode 100644 index 0000000000..cbfb1260e4 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java @@ -0,0 +1,12 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.vaadin.terminal.gwt.client.communication.ClientRpc; + +public interface GreetAgainRpc extends ClientRpc { + + public void greetAgain(); + +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java new file mode 100644 index 0000000000..d2066c53c8 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java @@ -0,0 +1,48 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.google.gwt.user.client.Window; +import com.vaadin.terminal.gwt.client.ServerConnector; +import com.vaadin.terminal.gwt.client.Util; +import com.vaadin.terminal.gwt.client.VConsole; +import com.vaadin.terminal.gwt.client.communication.RpcProxy; +import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector; +import com.vaadin.terminal.gwt.client.ui.Connect; +import com.vaadin.tests.extensions.HelloWorldExtension; + +@Connect(HelloWorldExtension.class) +public class HelloWorldExtensionConnector extends AbstractExtensionConnector { + HelloWorldRpc rpc = RpcProxy.create(HelloWorldRpc.class, this); + + @Override + public HelloWorldState getState() { + return (HelloWorldState) super.getState(); + } + + @Override + protected void init() { + registerRpc(GreetAgainRpc.class, new GreetAgainRpc() { + public void greetAgain() { + greet(); + } + }); + } + + @Override + public void setParent(ServerConnector parent) { + super.setParent(parent); + greet(); + } + + private void greet() { + String msg = getState().getGreeting() + " from " + + Util.getConnectorString(this) + " attached to " + + Util.getConnectorString(getParent()); + VConsole.log(msg); + + String response = Window.prompt(msg, ""); + rpc.onMessageSent(response); + } +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java new file mode 100644 index 0000000000..a7a3b091bf --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java @@ -0,0 +1,10 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.vaadin.terminal.gwt.client.communication.ServerRpc; + +public interface HelloWorldRpc extends ServerRpc { + public void onMessageSent(String message); +} diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java new file mode 100644 index 0000000000..f26824c781 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java @@ -0,0 +1,18 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.widgetset.client.helloworldfeature; + +import com.vaadin.terminal.gwt.client.communication.SharedState; + +public class HelloWorldState extends SharedState { + private String greeting = "Hello world"; + + public String getGreeting() { + return greeting; + } + + public void setGreeting(String greeting) { + this.greeting = greeting; + } +} -- cgit v1.2.3 From d4d61d68982b5ce5ff435ab7c8644709cdc5950e Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Tue, 26 Jun 2012 15:02:39 +0000 Subject: #8193 Listen to RootPanel keydown events to handle shortcut actions from PopupPanel/VOverlay widgets svn changeset:23977/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VView.java | 27 ++++++-- src/com/vaadin/terminal/gwt/client/ui/VWindow.java | 3 + .../popupview/PopupViewClickShortcut.java | 75 ++++++++++++++++++++++ 3 files changed, 100 insertions(+), 5 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 6fdacc9607..3f0347c306 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -18,6 +18,8 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.DomEvent.Type; +import com.google.gwt.event.dom.client.KeyDownEvent; +import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.EventHandler; @@ -136,12 +138,31 @@ public class VView extends SimplePanel implements Container, ResizeHandler, // should not be in the document focus flow getElement().setTabIndex(-1); TouchScrollDelegate.enableTouchScrolling(this, getElement()); + + // Handle shortcut actions originated from the main window. Subwindow + // shortcut actions are handled by the subwindows themselves. + RootPanel.get().addDomHandler(new KeyDownHandler() { + public void onKeyDown(KeyDownEvent event) { + + Event nativeEvent = event.getNativeEvent().cast(); + com.google.gwt.user.client.Element target = nativeEvent + .getEventTarget().cast(); + // Ensure the event originates from our application even in case + // we're embedded. + if (actionHandler != null + && (!isEmbedded() || (Util.getPaintableForElement( + connection, getParent(), target) != null))) { + actionHandler.handleKeyboardEvent(nativeEvent); + } + } + }, KeyDownEvent.getType()); } /** * Start to periodically monitor for parent element resizes if embedded * application (e.g. portlet). */ + @Override protected void onLoad() { super.onLoad(); if (isMonitoringParentSize()) { @@ -569,10 +590,7 @@ public class VView extends SimplePanel implements Container, ResizeHandler, public void onBrowserEvent(Event event) { super.onBrowserEvent(event); int type = DOM.eventGetType(event); - if (type == Event.ONKEYDOWN && actionHandler != null) { - actionHandler.handleKeyboardEvent(event); - return; - } else if (scrollable && type == Event.ONSCROLL) { + if (scrollable && type == Event.ONSCROLL) { updateScrollPosition(); } } @@ -934,5 +952,4 @@ public class VView extends SimplePanel implements Container, ResizeHandler, public void focus() { getElement().focus(); } - } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java index 2384ee7ddd..9b124ae466 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java @@ -1377,6 +1377,9 @@ public class VWindow extends VOverlay implements Container, if (shortcutHandler != null) { shortcutHandler .handleKeyboardEvent(Event.as(event.getNativeEvent())); + // Don't let the event propagate to the RootPanel where VView + // listens to shortcut events of the main window. + event.stopPropagation(); return; } } diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java new file mode 100644 index 0000000000..7009d03f77 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java @@ -0,0 +1,75 @@ +package com.vaadin.tests.components.popupview; + +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.event.ShortcutAction.ModifierKey; +import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.ComponentContainer; +import com.vaadin.ui.Layout; +import com.vaadin.ui.PopupView; +import com.vaadin.ui.Table; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; + +public class PopupViewClickShortcut extends TestBase { + + private Window sub = new Window("Table", makeTable("Subwindow", KeyCode.S)); + + private Log log = new Log(5); + + @Override + protected void setup() { + sub.center(); + getMainWindow().addWindow(sub); + addComponent(log); + addComponent(new PopupView("Show popup table", makeTable("Popup", + KeyCode.P))); + addComponent(makeTable("Main window", KeyCode.M)); + sub.addComponent(new PopupView("Show popup table", makeTable( + "Subwindow popup", KeyCode.U))); + } + + private ComponentContainer makeTable(final String caption, int keyCode) { + final Table t = new Table(); + t.setSelectable(true); + t.setHeight("200px"); + t.setWidth("200px"); + t.addContainerProperty("foo", String.class, "foo"); + for (int i = 0; i < 5; i++) { + t.addItem(new String[] { "foo " + i }, i); + } + + final Layout l = new VerticalLayout(); + l.setCaption(caption); + l.setWidth(null); + + Button b = new Button("Submit " + caption, new Button.ClickListener() { + private int i = 5; + + public void buttonClick(ClickEvent event) { + log.log("Submitted from " + + event.getButton().getParent().getCaption()); + t.addItem(new String[] { "added " + i++ }, i); + } + }); + b.setClickShortcut(keyCode, ModifierKey.ALT); + + l.addComponent(t); + l.addComponent(b); + + return l; + } + + @Override + protected String getDescription() { + return "Enter ClickShortcut does not work with PopupView"; + } + + @Override + protected Integer getTicketNumber() { + return 8193; + } + +} -- cgit v1.2.3 From b55ff51e8c254c56bb415432102b878fa053d8f3 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Wed, 27 Jun 2012 16:52:09 +0300 Subject: Add @JavaScript and @StyleSheet and remove @LoadScripts (#9044) --- src/com/vaadin/annotations/JavaScript.java | 16 + src/com/vaadin/annotations/LoadScripts.java | 24 -- src/com/vaadin/annotations/StyleSheet.java | 16 + .../terminal/gwt/client/ApplicationConnection.java | 55 +++ .../vaadin/terminal/gwt/client/ResourceLoader.java | 401 +++++++++++++++++++++ .../gwt/server/AbstractCommunicationManager.java | 69 +++- .../terminal/gwt/server/BootstrapHandler.java | 53 +-- .../terminal/gwt/server/CommunicationManager.java | 3 +- .../gwt/server/PortletCommunicationManager.java | 4 +- .../BasicJavaScriptComponent.java | 4 +- .../extensions/SimpleJavaScriptExtensionTest.java | 6 +- 11 files changed, 565 insertions(+), 86 deletions(-) create mode 100644 src/com/vaadin/annotations/JavaScript.java delete mode 100644 src/com/vaadin/annotations/LoadScripts.java create mode 100644 src/com/vaadin/annotations/StyleSheet.java create mode 100644 src/com/vaadin/terminal/gwt/client/ResourceLoader.java (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/annotations/JavaScript.java b/src/com/vaadin/annotations/JavaScript.java new file mode 100644 index 0000000000..8e0bc09958 --- /dev/null +++ b/src/com/vaadin/annotations/JavaScript.java @@ -0,0 +1,16 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface JavaScript { + public String[] value(); +} diff --git a/src/com/vaadin/annotations/LoadScripts.java b/src/com/vaadin/annotations/LoadScripts.java deleted file mode 100644 index 84ac2d2fb7..0000000000 --- a/src/com/vaadin/annotations/LoadScripts.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Temporary hack used for ensuring external javascript libraries are included. - * To add a javascript, add this annotation to your Root class. - * - * @deprecated Will be removed in favor of a more robust solution before version - * 7.0.0 - */ -@Retention(RetentionPolicy.RUNTIME) -@Target(ElementType.TYPE) -@Deprecated -public @interface LoadScripts { - public String[] value(); - -} diff --git a/src/com/vaadin/annotations/StyleSheet.java b/src/com/vaadin/annotations/StyleSheet.java new file mode 100644 index 0000000000..40f75511dd --- /dev/null +++ b/src/com/vaadin/annotations/StyleSheet.java @@ -0,0 +1,16 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface StyleSheet { + public String[] value(); +} diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index f0470c8ee8..3ec4233c59 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -40,6 +40,8 @@ import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConfiguration.ErrorMessage; +import com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadEvent; +import com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadListener; import com.vaadin.terminal.gwt.client.communication.HasJavaScriptConnectorHelper; import com.vaadin.terminal.gwt.client.communication.JsonDecoder; import com.vaadin.terminal.gwt.client.communication.JsonEncoder; @@ -1067,6 +1069,14 @@ public class ApplicationConnection { json.getValueMap("typeMappings"), widgetSet); } + VConsole.log("Handling resource dependencies"); + if (json.containsKey("scriptDependencies")) { + loadScriptDependencies(json.getJSStringArray("scriptDependencies")); + } + if (json.containsKey("styleDependencies")) { + loadStyleDependencies(json.getJSStringArray("styleDependencies")); + } + handleUIDLDuration.logDuration( " * Handling type mappings from server completed", 10); /* @@ -1611,6 +1621,51 @@ public class ApplicationConnection { ApplicationConfiguration.runWhenWidgetsLoaded(c); } + private static void loadStyleDependencies(JsArrayString dependencies) { + // Assuming no reason to interpret in a defined order + ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { + public void onResourceLoad(ResourceLoadEvent event) { + ApplicationConfiguration.endWidgetLoading(); + } + }; + ResourceLoader loader = ResourceLoader.get(); + for (int i = 0; i < dependencies.length(); i++) { + ApplicationConfiguration.startWidgetLoading(); + loader.loadStylesheet(dependencies.get(i), resourceLoadListener); + } + } + + private static void loadScriptDependencies(final JsArrayString dependencies) { + if (dependencies.length() == 0) { + return; + } + + // Listener that loads the next when one is completed + ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { + public void onResourceLoad(ResourceLoadEvent event) { + if (dependencies.length() != 0) { + ApplicationConfiguration.startWidgetLoading(); + // Load next in chain (hopefully already preloaded) + event.getResourceLoader().loadScript(dependencies.shift(), + this); + } + // Call start for next before calling end for current + ApplicationConfiguration.endWidgetLoading(); + } + }; + + ResourceLoader loader = ResourceLoader.get(); + + // Start chain by loading first + ApplicationConfiguration.startWidgetLoading(); + loader.loadScript(dependencies.shift(), resourceLoadListener); + + // Preload all remaining + for (int i = 0; i < dependencies.length(); i++) { + loader.loadScript(dependencies.get(i), null); + } + } + // Redirect browser, null reloads current page private static native void redirect(String url) /*-{ diff --git a/src/com/vaadin/terminal/gwt/client/ResourceLoader.java b/src/com/vaadin/terminal/gwt/client/ResourceLoader.java new file mode 100644 index 0000000000..7abafbc216 --- /dev/null +++ b/src/com/vaadin/terminal/gwt/client/ResourceLoader.java @@ -0,0 +1,401 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ + +package com.vaadin.terminal.gwt.client; + +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.RepeatingCommand; +import com.google.gwt.dom.client.AnchorElement; +import com.google.gwt.dom.client.Document; +import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.LinkElement; +import com.google.gwt.dom.client.NodeList; +import com.google.gwt.dom.client.ObjectElement; +import com.google.gwt.dom.client.ScriptElement; + +/** + * ResourceLoader lets you dynamically include external scripts and styles on + * the page and lets you know when the resource has been loaded. + * + * You can also preload resources, allowing them to get cached by the browser + * without being evaluated. This enables downloading multiple resources at once + * while still controlling in which order e.g. scripts are executed. + * + * @author Vaadin Ltd + * @version @VERSION@ + * @since 7.0.0 + */ +public class ResourceLoader { + /** + * Event fired when a resource has been loaded. + */ + public static class ResourceLoadEvent { + private ResourceLoader loader; + private String resourceUrl; + private final boolean preload; + + /** + * Creates a new event. + * + * @param loader + * the resource loader that has loaded the resource + * @param resourceUrl + * the url of the loaded resource + * @param preload + * true if the resource has only been preloaded, false if + * it's fully loaded + */ + public ResourceLoadEvent(ResourceLoader loader, String resourceUrl, + boolean preload) { + this.loader = loader; + this.resourceUrl = resourceUrl; + this.preload = preload; + } + + /** + * Gets the resource loader that has fired this event + * + * @return the resource loader + */ + public ResourceLoader getResourceLoader() { + return loader; + } + + /** + * Gets the absolute url of the loaded resource. + * + * @return the absolute url of the loaded resource + */ + public String getResourceUrl() { + return resourceUrl; + } + + /** + * Returns true if the resource has been preloaded, false if it's fully + * loaded + * + * @see ResourceLoader#preloadResource(String, ResourceLoadListener) + * + * @return true if the resource has been preloaded, false if it's fully + * loaded + */ + public boolean isPreload() { + return preload; + } + } + + /** + * Event listener that gets notified when a resource has been loaded + */ + public interface ResourceLoadListener { + /** + * Notified this ResourceLoadListener that a resource has been loaded + * + * @see ResourceLoadEvent + * + * @param event + * a resource load event with information about the loaded + * resource + */ + public void onResourceLoad(ResourceLoadEvent event); + } + + private static final ResourceLoader INSTANCE = GWT + .create(ResourceLoader.class); + + private ApplicationConnection connection; + + private final Set loadedResources = new HashSet(); + private final Set preloadedResources = new HashSet(); + + private final Map> loadListeners = new HashMap>(); + private final Map> preloadListeners = new HashMap>(); + + private final Element head; + + /** + * Creates a new resource loader. You should generally not create you own + * resource loader, but instead use {@link ResourceLoader#get()} to get an + * instance. + */ + protected ResourceLoader() { + Document document = Document.get(); + head = document.getElementsByTagName("head").getItem(0); + + // detect already loaded scripts and stylesheets + NodeList scripts = document.getElementsByTagName("script"); + for (int i = 0; i < scripts.getLength(); i++) { + ScriptElement element = ScriptElement.as(scripts.getItem(i)); + String src = element.getSrc(); + if (src != null && src.length() != 0) { + loadedResources.add(src); + } + } + + NodeList links = document.getElementsByTagName("link"); + for (int i = 0; i < links.getLength(); i++) { + LinkElement linkElement = LinkElement.as(links.getItem(i)); + String rel = linkElement.getRel(); + String href = linkElement.getHref(); + if ("stylesheet".equalsIgnoreCase(rel) && href != null + && href.length() != 0) { + loadedResources.add(href); + } + } + } + + /** + * Returns the default ResourceLoader + * + * @return the default ResourceLoader + */ + public static ResourceLoader get() { + return INSTANCE; + } + + /** + * Load a script and notify a listener when the script is loaded. Calling + * this method when the script is currently loading or already loaded + * doesn't cause the script to be loaded again, but the listener will still + * be notified when appropriate. + * + * + * @param scriptUrl + * the url of the script to load + * @param resourceLoadListener + * the listener that will get notified when the script is loaded + */ + public void loadScript(final String scriptUrl, + final ResourceLoadListener resourceLoadListener) { + final String url = getAbsoluteUrl(scriptUrl); + if (loadedResources.contains(url)) { + if (resourceLoadListener != null) { + resourceLoadListener.onResourceLoad(new ResourceLoadEvent(this, + url, false)); + } + return; + } + + if (preloadListeners.containsKey(url)) { + preloadResource(url, new ResourceLoadListener() { + public void onResourceLoad(ResourceLoadEvent event) { + loadScript(url, resourceLoadListener); + } + }); + return; + } + + if (addListener(url, resourceLoadListener, loadListeners)) { + ScriptElement scriptTag = Document.get().createScriptElement(); + scriptTag.setSrc(url); + scriptTag.setType("text/javascript"); + addOnloadHandler(scriptTag, url, false); + head.appendChild(scriptTag); + } + } + + private static String getAbsoluteUrl(String url) { + AnchorElement a = Document.get().createAnchorElement(); + a.setHref(url); + return a.getHref(); + } + + /** + * Download a resource and notify a listener when the resource is loaded + * without attempting to interpret the resource. When a resource has been + * preloaded, it will be present in the browser's cache (provided the HTTP + * headers allow caching), making a subsequent load operation complete + * without having to wait for the resource to be downloaded again. + * + * Calling this method when the resource is currently loading, currently + * preloading, already preloaded or already loaded doesn't cause the + * resource to be preloaded again, but the listener will still be notified + * when appropriate. + * + * @param url + * the url of the resource to preload + * @param resourceLoadListener + * the listener that will get notified when the resource is + * preloaded + */ + public void preloadResource(String url, + ResourceLoadListener resourceLoadListener) { + url = getAbsoluteUrl(url); + if (loadedResources.contains(url) || preloadedResources.contains(url)) { + if (resourceLoadListener != null) { + resourceLoadListener.onResourceLoad(new ResourceLoadEvent(this, + url, !loadedResources.contains(url))); + } + return; + } + + if (addListener(url, resourceLoadListener, preloadListeners) + && !loadListeners.containsKey(url)) { + // Inject loader element if this is the first time this is preloaded + // AND the resources isn't already being loaded in the normal way + + Element element = getPreloadElement(url); + addOnloadHandler(element, url, true); + + // TODO Remove object when loaded (without causing spinner in FF) + Document.get().getBody().appendChild(element); + } + } + + private static Element getPreloadElement(String url) { + if (BrowserInfo.get().isIE()) { + ScriptElement element = Document.get().createScriptElement(); + element.setSrc(url); + element.setType("text/cache"); + return element; + } else { + ObjectElement element = Document.get().createObjectElement(); + element.setData(url); + element.setType("text/plain"); + element.setHeight("0px"); + element.setWidth("0px"); + return element; + } + } + + private native void addOnloadHandler(Element element, String url, + boolean preload) + /*-{ + var self = this; + var done = $entry(function() { + element.onloadDone = true; + element.onload = null; + element.onreadystatechange = null; + self.@com.vaadin.terminal.gwt.client.ResourceLoader::onResourceLoad(Ljava/lang/String;Z)(url, preload); + }); + element.onload = function() { + if (!element.onloadDone) { + done(); + } + }; + element.onreadystatechange = function() { + if (("loaded" === element.readyState || "complete" === element.readyState) && !element.onloadDone ) { + done(); + } + }; + }-*/; + + /** + * Load a stylesheet and notify a listener when the stylesheet is loaded. + * Calling this method when the stylesheet is currently loading or already + * loaded doesn't cause the stylesheet to be loaded again, but the listener + * will still be notified when appropriate. + * + * @param stylesheetUrl + * the url of the stylesheet to load + * @param resourceLoadListener + * the listener that will get notified when the stylesheet is + * loaded + */ + public void loadStylesheet(final String stylesheetUrl, + final ResourceLoadListener resourceLoadListener) { + final String url = getAbsoluteUrl(stylesheetUrl); + if (loadedResources.contains(url)) { + if (resourceLoadListener != null) { + resourceLoadListener.onResourceLoad(new ResourceLoadEvent(this, + url, false)); + } + return; + } + + if (preloadListeners.containsKey(url)) { + preloadResource(url, new ResourceLoadListener() { + public void onResourceLoad(ResourceLoadEvent event) { + loadStylesheet(url, resourceLoadListener); + } + }); + return; + } + + if (addListener(url, resourceLoadListener, loadListeners)) { + LinkElement linkElement = Document.get().createLinkElement(); + linkElement.setRel("stylesheet"); + linkElement.setType("text/css"); + linkElement.setHref(url); + + if (BrowserInfo.get().isSafari()) { + // Safari doesn't fire onload events for link elements + // See http://www.phpied.com/when-is-a-stylesheet-really-loaded/ + // TODO Stop checking after some timeout + Scheduler.get().scheduleFixedPeriod(new RepeatingCommand() { + public boolean execute() { + if (isStyleSheetPresent(url)) { + onResourceLoad(url, false); + return false; // Stop repeating + } else { + return true; // Continue repeating + } + } + }, 10); + } else { + addOnloadHandler(linkElement, url, false); + } + + head.appendChild(linkElement); + } + } + + private static native boolean isStyleSheetPresent(String url) + /*-{ + for(var i = 0; i < $doc.styleSheets.length; i++) { + if ($doc.styleSheets[i].href === url) { + return true; + } + } + return false; + }-*/; + + private static boolean addListener(String url, + ResourceLoadListener listener, + Map> listenerMap) { + Collection listeners = listenerMap.get(url); + if (listeners == null) { + listeners = new HashSet(); + listeners.add(listener); + listenerMap.put(url, listeners); + return true; + } else { + listeners.add(listener); + return false; + } + } + + private void onResourceLoad(String resource, boolean preload) { + Collection listeners; + if (preload) { + preloadedResources.add(resource); + listeners = preloadListeners.remove(resource); + } else { + if (preloadListeners.containsKey(resource)) { + // Also fire preload events for potential listeners + onResourceLoad(resource, true); + } + preloadedResources.remove(resource); + loadedResources.add(resource); + listeners = loadListeners.remove(resource); + } + if (listeners != null && !listeners.isEmpty()) { + ResourceLoadEvent event = new ResourceLoadEvent(this, resource, + preload); + for (ResourceLoadListener listener : listeners) { + if (listener != null) { + listener.onResourceLoad(event); + } + } + } + } + +} diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 7cad8e3a33..c65b8947d6 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -25,6 +25,7 @@ import java.text.DateFormatSymbols; import java.text.SimpleDateFormat; import java.text.StringCharacterIterator; import java.util.ArrayList; +import java.util.Arrays; import java.util.Calendar; import java.util.Collection; import java.util.Collections; @@ -46,6 +47,8 @@ import com.vaadin.Application; import com.vaadin.Application.SystemMessages; import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.Version; +import com.vaadin.annotations.JavaScript; +import com.vaadin.annotations.StyleSheet; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; @@ -497,10 +500,11 @@ public abstract class AbstractCommunicationManager implements Serializable { * found * @throws IOException * @throws InvalidUIDLSecurityKeyException + * @throws JSONException */ public void handleUidlRequest(WrappedRequest request, WrappedResponse response, Callback callback, Root root) - throws IOException, InvalidUIDLSecurityKeyException { + throws IOException, InvalidUIDLSecurityKeyException, JSONException { checkWidgetsetVersion(request); requestThemeName = request.getParameter("theme"); @@ -696,11 +700,12 @@ public abstract class AbstractCommunicationManager implements Serializable { * @param analyzeLayouts * @throws PaintException * @throws IOException + * @throws JSONException */ private void paintAfterVariableChanges(WrappedRequest request, WrappedResponse response, Callback callback, boolean repaintAll, final PrintWriter outWriter, Root root, boolean analyzeLayouts) - throws PaintException, IOException { + throws PaintException, IOException, JSONException { // Removes application if it has stopped during variable changes if (!application.isRunning()) { @@ -764,7 +769,7 @@ public abstract class AbstractCommunicationManager implements Serializable { @SuppressWarnings("unchecked") public void writeUidlResponse(WrappedRequest request, boolean repaintAll, final PrintWriter outWriter, Root root, boolean analyzeLayouts) - throws PaintException { + throws PaintException, JSONException { ArrayList dirtyVisibleConnectors = new ArrayList(); Application application = root.getApplication(); // Paints components @@ -1095,10 +1100,14 @@ public abstract class AbstractCommunicationManager implements Serializable { boolean typeMappingsOpen = false; ClientCache clientCache = getClientCache(root); + List> newConnectorTypes = new ArrayList>(); + for (Class class1 : usedClientConnectors) { if (clientCache.cache(class1)) { // client does not know the mapping key for this type, send // mapping to client + newConnectorTypes.add(class1); + if (!typeMappingsOpen) { typeMappingsOpen = true; outWriter.print(", \"typeMappings\" : { "); @@ -1142,6 +1151,54 @@ public abstract class AbstractCommunicationManager implements Serializable { } } + /* + * Ensure super classes come before sub classes to get script dependency + * order right. Sub class @JavaScript might assume that @JavaScript + * defined by super class is already loaded. + */ + Collections.sort(newConnectorTypes, new Comparator>() { + public int compare(Class o1, Class o2) { + // TODO optimize using Class.isAssignableFrom? + return hierarchyDepth(o1) - hierarchyDepth(o2); + } + + private int hierarchyDepth(Class type) { + if (type == Object.class) { + return 0; + } else { + return hierarchyDepth(type.getSuperclass()) + 1; + } + } + }); + + List scriptDependencies = new ArrayList(); + List styleDependencies = new ArrayList(); + + for (Class class1 : newConnectorTypes) { + JavaScript jsAnnotation = class1.getAnnotation(JavaScript.class); + if (jsAnnotation != null) { + scriptDependencies.addAll(Arrays.asList(jsAnnotation.value())); + } + + StyleSheet styleAnnotation = class1.getAnnotation(StyleSheet.class); + if (styleAnnotation != null) { + styleDependencies + .addAll(Arrays.asList(styleAnnotation.value())); + } + } + + // Include script dependencies in output if there are any + if (!scriptDependencies.isEmpty()) { + outWriter.print(", \"scriptDependencies\": " + + new JSONArray(scriptDependencies).toString()); + } + + // Include style dependencies in output if there are any + if (!styleDependencies.isEmpty()) { + outWriter.print(", \"styleDependencies\": " + + new JSONArray(styleDependencies).toString()); + } + // add any pending locale definitions requested by the client printLocaleDeclarations(outWriter); @@ -1380,7 +1437,7 @@ public abstract class AbstractCommunicationManager implements Serializable { private boolean handleVariables(WrappedRequest request, WrappedResponse response, Callback callback, Application application2, Root root) throws IOException, - InvalidUIDLSecurityKeyException { + InvalidUIDLSecurityKeyException, JSONException { boolean success = true; String changes = getRequestPayload(request); @@ -2256,9 +2313,11 @@ public abstract class AbstractCommunicationManager implements Serializable { * @return a string with the initial UIDL message * @throws PaintException * if an exception occurs while painting + * @throws JSONException + * if an exception occurs while encoding output */ protected String getInitialUIDL(WrappedRequest request, Root root) - throws PaintException { + throws PaintException, JSONException { // TODO maybe unify writeUidlResponse()? StringWriter sWriter = new StringWriter(); PrintWriter pWriter = new PrintWriter(sWriter); diff --git a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java index 69f033c8cd..d32fa325f4 100644 --- a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java +++ b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java @@ -9,10 +9,6 @@ import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Serializable; import java.io.Writer; -import java.lang.annotation.Annotation; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; @@ -20,7 +16,6 @@ import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; import com.vaadin.RootRequiresMoreInformationException; import com.vaadin.Version; -import com.vaadin.annotations.LoadScripts; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; import com.vaadin.terminal.DeploymentConfiguration; @@ -490,50 +485,6 @@ public abstract class BootstrapHandler implements RequestHandler { page.write("" + AbstractApplicationServlet.safeEscapeForHtml(title) + "\n"); - - if (root != null) { - List loadScriptsAnnotations = getAnnotationsFor( - root.getClass(), LoadScripts.class); - Collections.reverse(loadScriptsAnnotations); - // Begin from the end as a class might requests scripts that depend - // on script loaded by a super class - for (int i = loadScriptsAnnotations.size() - 1; i >= 0; i--) { - LoadScripts loadScripts = loadScriptsAnnotations.get(i); - String[] value = loadScripts.value(); - if (value != null) { - for (String script : value) { - page.write("\n"); - } - } - } - - } - } - - private static List getAnnotationsFor( - Class type, Class annotationType) { - List list = new ArrayList(); - // Find from the class hierarchy - Class currentType = type; - while (currentType != Object.class) { - T annotation = currentType.getAnnotation(annotationType); - if (annotation != null) { - list.add(annotation); - } - currentType = currentType.getSuperclass(); - } - - // Find from an implemented interface - for (Class iface : type.getInterfaces()) { - T annotation = iface.getAnnotation(annotationType); - if (annotation != null) { - list.add(annotation); - } - } - - return list; } /** @@ -645,8 +596,10 @@ public abstract class BootstrapHandler implements RequestHandler { * @return a string with the initial UIDL message * @throws PaintException * if an exception occurs while painting the components + * @throws JSONException + * if an exception occurs while formatting the output */ protected abstract String getInitialUIDL(WrappedRequest request, Root root) - throws PaintException; + throws PaintException, JSONException; } diff --git a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java index cc2981dc45..2d2888e034 100644 --- a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java @@ -15,6 +15,7 @@ import java.util.UUID; import javax.servlet.ServletContext; import com.vaadin.Application; +import com.vaadin.external.json.JSONException; import com.vaadin.terminal.PaintException; import com.vaadin.terminal.StreamVariable; import com.vaadin.terminal.WrappedRequest; @@ -245,7 +246,7 @@ public class CommunicationManager extends AbstractCommunicationManager { @Override protected String getInitialUIDL(WrappedRequest request, Root root) - throws PaintException { + throws PaintException, JSONException { return CommunicationManager.this.getInitialUIDL(request, root); } }; diff --git a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java index d3fbf4d988..7398315ee2 100644 --- a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java @@ -104,7 +104,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { @Override public void handleUidlRequest(WrappedRequest request, WrappedResponse response, Callback callback, Root root) - throws IOException, InvalidUIDLSecurityKeyException { + throws IOException, InvalidUIDLSecurityKeyException, JSONException { setCurrentMimeReponse(response); super.handleUidlRequest(request, response, callback, root); currentMimeResponse = null; @@ -253,7 +253,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { @Override protected String getInitialUIDL(WrappedRequest request, Root root) - throws PaintException { + throws PaintException, JSONException { return PortletCommunicationManager.this.getInitialUIDL(request, root); } diff --git a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index 5f2f945c8b..15c5f6b642 100644 --- a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -6,7 +6,7 @@ package com.vaadin.tests.components.javascriptcomponent; import java.util.Arrays; import java.util.List; -import com.vaadin.annotations.LoadScripts; +import com.vaadin.annotations.JavaScript; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; import com.vaadin.terminal.WrappedRequest; @@ -17,7 +17,6 @@ import com.vaadin.ui.AbstractJavaScriptComponent; import com.vaadin.ui.JavaScriptCallback; import com.vaadin.ui.Notification; -@LoadScripts({ "/statictestfiles/jsconnector.js" }) public class BasicJavaScriptComponent extends AbstractTestRoot { public interface ExampleClickRpc extends ServerRpc { @@ -36,6 +35,7 @@ public class BasicJavaScriptComponent extends AbstractTestRoot { } } + @JavaScript("/statictestfiles/jsconnector.js") public static class ExampleWidget extends AbstractJavaScriptComponent { public ExampleWidget() { registerRpc(new ExampleClickRpc() { diff --git a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index bbfe3f0f46..72168c08df 100644 --- a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -4,7 +4,8 @@ package com.vaadin.tests.extensions; -import com.vaadin.annotations.LoadScripts; +import com.vaadin.annotations.JavaScript; +import com.vaadin.annotations.StyleSheet; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; import com.vaadin.terminal.AbstractJavaScriptExtension; @@ -18,7 +19,6 @@ import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.JavaScriptCallback; import com.vaadin.ui.Notification; -@LoadScripts({ "/statictestfiles/jsextension.js" }) public class SimpleJavaScriptExtensionTest extends AbstractTestRoot { public static class SimpleJavaScriptExtensionState extends @@ -44,6 +44,8 @@ public class SimpleJavaScriptExtensionTest extends AbstractTestRoot { public void greet(String message); } + @JavaScript("/statictestfiles/jsextension.js") + @StyleSheet("/VAADIN/external1.css") public static class SimpleJavascriptExtension extends AbstractJavaScriptExtension { -- cgit v1.2.3 From 236fd821354b6906c9100c13f7912738ac19c70a Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Wed, 27 Jun 2012 17:08:38 +0300 Subject: Rename widget -> dependency in delayed load handling (#9044) --- .../gwt/client/ApplicationConfiguration.java | 20 ++++++++++---------- .../terminal/gwt/client/ApplicationConnection.java | 12 ++++++------ src/com/vaadin/terminal/gwt/client/WidgetLoader.java | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 960b0a8b0e..540841a6ae 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -218,7 +218,7 @@ public class ApplicationConfiguration implements EntryPoint { static// TODO consider to make this hashmap per application LinkedList callbacks = new LinkedList(); - private static int widgetsLoading; + private static int dependenciesLoading; private static ArrayList runningApplications = new ArrayList(); @@ -454,26 +454,26 @@ public class ApplicationConfiguration implements EntryPoint { * * @param c */ - static void runWhenWidgetsLoaded(Command c) { - if (widgetsLoading == 0) { + static void runWhenDependenciesLoaded(Command c) { + if (dependenciesLoading == 0) { c.execute(); } else { callbacks.add(c); } } - static void startWidgetLoading() { - widgetsLoading++; + static void startDependencyLoading() { + dependenciesLoading++; } - static void endWidgetLoading() { - widgetsLoading--; - if (widgetsLoading == 0 && !callbacks.isEmpty()) { + static void endDependencyLoading() { + dependenciesLoading--; + if (dependenciesLoading == 0 && !callbacks.isEmpty()) { for (Command cmd : callbacks) { cmd.execute(); } callbacks.clear(); - } else if (widgetsLoading == 0 && deferredWidgetLoader != null) { + } else if (dependenciesLoading == 0 && deferredWidgetLoader != null) { deferredWidgetLoader.trigger(); } @@ -534,7 +534,7 @@ public class ApplicationConfiguration implements EntryPoint { } private boolean isBusy() { - if (widgetsLoading > 0) { + if (dependenciesLoading > 0) { communicationFree = 0; return true; } diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 3ec4233c59..ab9520240c 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -1618,19 +1618,19 @@ public class ApplicationConnection { } }; - ApplicationConfiguration.runWhenWidgetsLoaded(c); + ApplicationConfiguration.runWhenDependenciesLoaded(c); } private static void loadStyleDependencies(JsArrayString dependencies) { // Assuming no reason to interpret in a defined order ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { public void onResourceLoad(ResourceLoadEvent event) { - ApplicationConfiguration.endWidgetLoading(); + ApplicationConfiguration.endDependencyLoading(); } }; ResourceLoader loader = ResourceLoader.get(); for (int i = 0; i < dependencies.length(); i++) { - ApplicationConfiguration.startWidgetLoading(); + ApplicationConfiguration.startDependencyLoading(); loader.loadStylesheet(dependencies.get(i), resourceLoadListener); } } @@ -1644,20 +1644,20 @@ public class ApplicationConnection { ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { public void onResourceLoad(ResourceLoadEvent event) { if (dependencies.length() != 0) { - ApplicationConfiguration.startWidgetLoading(); + ApplicationConfiguration.startDependencyLoading(); // Load next in chain (hopefully already preloaded) event.getResourceLoader().loadScript(dependencies.shift(), this); } // Call start for next before calling end for current - ApplicationConfiguration.endWidgetLoading(); + ApplicationConfiguration.endDependencyLoading(); } }; ResourceLoader loader = ResourceLoader.get(); // Start chain by loading first - ApplicationConfiguration.startWidgetLoading(); + ApplicationConfiguration.startDependencyLoading(); loader.loadScript(dependencies.shift(), resourceLoadListener); // Preload all remaining diff --git a/src/com/vaadin/terminal/gwt/client/WidgetLoader.java b/src/com/vaadin/terminal/gwt/client/WidgetLoader.java index 16e99716a0..491e569411 100644 --- a/src/com/vaadin/terminal/gwt/client/WidgetLoader.java +++ b/src/com/vaadin/terminal/gwt/client/WidgetLoader.java @@ -9,12 +9,12 @@ import com.google.gwt.core.client.RunAsyncCallback; abstract class WidgetLoader implements RunAsyncCallback { public void onFailure(Throwable reason) { - ApplicationConfiguration.endWidgetLoading(); + ApplicationConfiguration.endDependencyLoading(); } public void onSuccess() { addInstantiator(); - ApplicationConfiguration.endWidgetLoading(); + ApplicationConfiguration.endDependencyLoading(); } abstract void addInstantiator(); -- cgit v1.2.3 From 23bafe0cf09918bc2c80455de1607be0035ee250 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 Jun 2012 10:24:48 +0300 Subject: Updated javadoc --- .../terminal/gwt/client/ui/label/ContentMode.java | 22 ++++++++++------------ src/com/vaadin/ui/Label.java | 12 +++++++----- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/label/ContentMode.java b/src/com/vaadin/terminal/gwt/client/ui/label/ContentMode.java index 4892c7e6bd..5e621681c3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/label/ContentMode.java +++ b/src/com/vaadin/terminal/gwt/client/ui/label/ContentMode.java @@ -10,38 +10,36 @@ package com.vaadin.terminal.gwt.client.ui.label; */ public enum ContentMode { /** - * Content mode, where the label contains only plain text. The getValue() - * result is coded to XML when painting. + * Content mode, where the label contains only plain text. */ TEXT, /** - * Content mode, where the label contains preformatted text. + * Content mode, where the label contains pre formatted text. In this mode + * newlines are preserved when rendered on the screen. */ PREFORMATTED, /** - * Content mode, where the label contains XHTML. + * Content mode, where the label contains XHTML. Care should be taken to + * ensure */ XHTML, /** * Content mode, where the label contains well-formed or well-balanced XML. - * Each of the root elements must have their default namespace specified. + * This is handled in the same way as {@link #XHTML}. * - * @deprecated Use {@link #XHTML} + * @deprecated Use {@link #XHTML} instead */ @Deprecated XML, /** - * Content mode, where the label contains RAW output. Output is not required - * to comply to with XML. In Web Adapter output is inserted inside the - * resulting HTML document as-is. This is useful for some specific purposes - * where possibly broken HTML content needs to be shown, but in most cases - * XHTML mode should be preferred. + * Legacy content mode, where the label contains RAW output. This is handled + * in exactly the same way as {@link #XHTML}. * - * @deprecated Use {@link #XHTML}, {@link #TEXT} or {@link #PREFORMATTED}. + * @deprecated Use {@link #XHTML} instead */ @Deprecated RAW; diff --git a/src/com/vaadin/ui/Label.java b/src/com/vaadin/ui/Label.java index e1c64605d7..e98da384cf 100644 --- a/src/com/vaadin/ui/Label.java +++ b/src/com/vaadin/ui/Label.java @@ -142,10 +142,13 @@ public class Label extends AbstractComponent implements Property, } /** - * Gets the value of the label. Value of the label is the XML contents of - * the label. + * Gets the value of the label. + *

+ * The value of the label is the text that is shown to the end user. + * Depending on the {@link ContentMode} it is plain text or markup. + *

* - * @return the Value of the label. + * @return the value of the label. */ public String getValue() { if (getPropertyDataSource() == null) { @@ -180,8 +183,7 @@ public class Label extends AbstractComponent implements Property, /** * @see java.lang.Object#toString() - * @deprecated use the data source value or {@link #getStringValue()} - * instead + * @deprecated Use {@link #getValue()} instead */ @Deprecated @Override -- cgit v1.2.3 From 41ba62d05946c7aef3998b95c63dd09c6af75c69 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 28 Jun 2012 11:47:55 +0300 Subject: Add error handling to ResourceLoader (#9044) --- .../terminal/gwt/client/ApplicationConnection.java | 17 +- .../vaadin/terminal/gwt/client/ResourceLoader.java | 206 +++++++++++++++++---- 2 files changed, 182 insertions(+), 41 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index ab9520240c..c6320f941b 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -1624,9 +1624,16 @@ public class ApplicationConnection { private static void loadStyleDependencies(JsArrayString dependencies) { // Assuming no reason to interpret in a defined order ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { - public void onResourceLoad(ResourceLoadEvent event) { + public void onLoad(ResourceLoadEvent event) { ApplicationConfiguration.endDependencyLoading(); } + + public void onError(ResourceLoadEvent event) { + VConsole.error(event.getResourceUrl() + + " could not be loaded, or the load detection failed because the stylesheet is empty."); + // The show must go on + onLoad(event); + } }; ResourceLoader loader = ResourceLoader.get(); for (int i = 0; i < dependencies.length(); i++) { @@ -1642,7 +1649,7 @@ public class ApplicationConnection { // Listener that loads the next when one is completed ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { - public void onResourceLoad(ResourceLoadEvent event) { + public void onLoad(ResourceLoadEvent event) { if (dependencies.length() != 0) { ApplicationConfiguration.startDependencyLoading(); // Load next in chain (hopefully already preloaded) @@ -1652,6 +1659,12 @@ public class ApplicationConnection { // Call start for next before calling end for current ApplicationConfiguration.endDependencyLoading(); } + + public void onError(ResourceLoadEvent event) { + VConsole.error(event.getResourceUrl() + " could not be loaded."); + // The show must go on + onLoad(event); + } }; ResourceLoader loader = ResourceLoader.get(); diff --git a/src/com/vaadin/terminal/gwt/client/ResourceLoader.java b/src/com/vaadin/terminal/gwt/client/ResourceLoader.java index 7abafbc216..8c481e0356 100644 --- a/src/com/vaadin/terminal/gwt/client/ResourceLoader.java +++ b/src/com/vaadin/terminal/gwt/client/ResourceLoader.java @@ -10,6 +10,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; +import com.google.gwt.core.client.Duration; import com.google.gwt.core.client.GWT; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.RepeatingCommand; @@ -20,6 +21,7 @@ import com.google.gwt.dom.client.LinkElement; import com.google.gwt.dom.client.NodeList; import com.google.gwt.dom.client.ObjectElement; import com.google.gwt.dom.client.ScriptElement; +import com.google.gwt.user.client.Timer; /** * ResourceLoader lets you dynamically include external scripts and styles on @@ -97,7 +99,9 @@ public class ResourceLoader { */ public interface ResourceLoadListener { /** - * Notified this ResourceLoadListener that a resource has been loaded + * Notifies this ResourceLoadListener that a resource has been loaded. + * Some browsers do not support any way of detecting load errors. In + * these cases, onLoad will be called regardless of the status. * * @see ResourceLoadEvent * @@ -105,7 +109,22 @@ public class ResourceLoader { * a resource load event with information about the loaded * resource */ - public void onResourceLoad(ResourceLoadEvent event); + public void onLoad(ResourceLoadEvent event); + + /** + * Notifies this ResourceLoadListener that a resource could not be + * loaded, e.g. because the file could not be found or because the + * server did not respond. Some browsers do not support any way of + * detecting load errors. In these cases, onLoad will be called + * regardless of the status. + * + * @see ResourceLoadEvent + * + * @param event + * a resource load event with information about the resource + * that could not be loaded. + */ + public void onError(ResourceLoadEvent event); } private static final ResourceLoader INSTANCE = GWT @@ -176,19 +195,27 @@ public class ResourceLoader { public void loadScript(final String scriptUrl, final ResourceLoadListener resourceLoadListener) { final String url = getAbsoluteUrl(scriptUrl); + ResourceLoadEvent event = new ResourceLoadEvent(this, url, false); if (loadedResources.contains(url)) { if (resourceLoadListener != null) { - resourceLoadListener.onResourceLoad(new ResourceLoadEvent(this, - url, false)); + resourceLoadListener.onLoad(event); } return; } if (preloadListeners.containsKey(url)) { + // Preload going on, continue when preloaded preloadResource(url, new ResourceLoadListener() { - public void onResourceLoad(ResourceLoadEvent event) { + public void onLoad(ResourceLoadEvent event) { loadScript(url, resourceLoadListener); } + + public void onError(ResourceLoadEvent event) { + // Preload failed -> signal error to own listener + if (resourceLoadListener != null) { + resourceLoadListener.onError(event); + } + } }); return; } @@ -197,7 +224,15 @@ public class ResourceLoader { ScriptElement scriptTag = Document.get().createScriptElement(); scriptTag.setSrc(url); scriptTag.setType("text/javascript"); - addOnloadHandler(scriptTag, url, false); + addOnloadHandler(scriptTag, new ResourceLoadListener() { + public void onLoad(ResourceLoadEvent event) { + fireLoad(event); + } + + public void onError(ResourceLoadEvent event) { + fireError(event); + } + }, event); head.appendChild(scriptTag); } } @@ -229,10 +264,11 @@ public class ResourceLoader { public void preloadResource(String url, ResourceLoadListener resourceLoadListener) { url = getAbsoluteUrl(url); + ResourceLoadEvent event = new ResourceLoadEvent(this, url, true); if (loadedResources.contains(url) || preloadedResources.contains(url)) { + // Already loaded or preloaded -> just fire listener if (resourceLoadListener != null) { - resourceLoadListener.onResourceLoad(new ResourceLoadEvent(this, - url, !loadedResources.contains(url))); + resourceLoadListener.onLoad(event); } return; } @@ -243,7 +279,15 @@ public class ResourceLoader { // AND the resources isn't already being loaded in the normal way Element element = getPreloadElement(url); - addOnloadHandler(element, url, true); + addOnloadHandler(element, new ResourceLoadListener() { + public void onLoad(ResourceLoadEvent event) { + fireLoad(event); + } + + public void onError(ResourceLoadEvent event) { + fireError(event); + } + }, event); // TODO Remove object when loaded (without causing spinner in FF) Document.get().getBody().appendChild(element); @@ -266,24 +310,24 @@ public class ResourceLoader { } } - private native void addOnloadHandler(Element element, String url, - boolean preload) + private native void addOnloadHandler(Element element, + ResourceLoadListener listener, ResourceLoadEvent event) /*-{ - var self = this; - var done = $entry(function() { - element.onloadDone = true; + element.onload = $entry(function() { element.onload = null; + element.onerror = null; element.onreadystatechange = null; - self.@com.vaadin.terminal.gwt.client.ResourceLoader::onResourceLoad(Ljava/lang/String;Z)(url, preload); + listener.@com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadListener::onLoad(Lcom/vaadin/terminal/gwt/client/ResourceLoader$ResourceLoadEvent;)(event); + }); + element.onerror = $entry(function() { + element.onload = null; + element.onerror = null; + element.onreadystatechange = null; + listener.@com.vaadin.terminal.gwt.client.ResourceLoader.ResourceLoadListener::onError(Lcom/vaadin/terminal/gwt/client/ResourceLoader$ResourceLoadEvent;)(event); }); - element.onload = function() { - if (!element.onloadDone) { - done(); - } - }; element.onreadystatechange = function() { - if (("loaded" === element.readyState || "complete" === element.readyState) && !element.onloadDone ) { - done(); + if ("loaded" === element.readyState || "complete" === element.readyState ) { + element.onload(arguments[0]); } }; }-*/; @@ -303,19 +347,27 @@ public class ResourceLoader { public void loadStylesheet(final String stylesheetUrl, final ResourceLoadListener resourceLoadListener) { final String url = getAbsoluteUrl(stylesheetUrl); + final ResourceLoadEvent event = new ResourceLoadEvent(this, url, false); if (loadedResources.contains(url)) { if (resourceLoadListener != null) { - resourceLoadListener.onResourceLoad(new ResourceLoadEvent(this, - url, false)); + resourceLoadListener.onLoad(event); } return; } if (preloadListeners.containsKey(url)) { + // Preload going on, continue when preloaded preloadResource(url, new ResourceLoadListener() { - public void onResourceLoad(ResourceLoadEvent event) { + public void onLoad(ResourceLoadEvent event) { loadStylesheet(url, resourceLoadListener); } + + public void onError(ResourceLoadEvent event) { + // Preload failed -> signal error to own listener + if (resourceLoadListener != null) { + resourceLoadListener.onError(event); + } + } }); return; } @@ -327,35 +379,92 @@ public class ResourceLoader { linkElement.setHref(url); if (BrowserInfo.get().isSafari()) { - // Safari doesn't fire onload events for link elements + // Safari doesn't fire any events for link elements // See http://www.phpied.com/when-is-a-stylesheet-really-loaded/ - // TODO Stop checking after some timeout Scheduler.get().scheduleFixedPeriod(new RepeatingCommand() { + private final Duration duration = new Duration(); + public boolean execute() { - if (isStyleSheetPresent(url)) { - onResourceLoad(url, false); + int styleSheetLength = getStyleSheetLength(url); + if (getStyleSheetLength(url) > 0) { + fireLoad(event); return false; // Stop repeating + } else if (styleSheetLength == 0) { + // "Loaded" empty sheet -> most likely 404 error + fireError(event); + return true; + } else if (duration.elapsedMillis() > 60 * 1000) { + fireError(event); + return false; } else { return true; // Continue repeating } } }, 10); } else { - addOnloadHandler(linkElement, url, false); + addOnloadHandler(linkElement, new ResourceLoadListener() { + public void onLoad(ResourceLoadEvent event) { + // Chrome && IE fires load for errors, must check + // stylesheet data + if (BrowserInfo.get().isChrome() + || BrowserInfo.get().isIE()) { + int styleSheetLength = getStyleSheetLength(url); + // Error if there's an empty stylesheet + if (styleSheetLength == 0) { + fireError(event); + return; + } + } + fireLoad(event); + } + + public void onError(ResourceLoadEvent event) { + fireError(event); + } + }, event); + if (BrowserInfo.get().isOpera()) { + // Opera onerror never fired, assume error if no onload in x + // seconds + new Timer() { + @Override + public void run() { + if (!loadedResources.contains(url)) { + fireError(event); + } + } + }.schedule(5 * 1000); + } } head.appendChild(linkElement); } } - private static native boolean isStyleSheetPresent(String url) + private static native int getStyleSheetLength(String url) /*-{ for(var i = 0; i < $doc.styleSheets.length; i++) { if ($doc.styleSheets[i].href === url) { - return true; + var sheet = $doc.styleSheets[i]; + try { + var rules = sheet.cssRules + if (rules === undefined) { + rules = sheet.rules; + } + + if (rules === null) { + // Style sheet loaded, but can't access length because of XSS -> assume there's something there + return 1; + } + + // Return length so we can distinguish 0 (probably 404 error) from normal case. + return rules.length; + } catch (err) { + return 1; + } } } - return false; + // No matching stylesheet found -> not yet loaded + return -1; }-*/; private static boolean addListener(String url, @@ -373,26 +482,45 @@ public class ResourceLoader { } } - private void onResourceLoad(String resource, boolean preload) { + private void fireError(ResourceLoadEvent event) { + String resource = event.getResourceUrl(); + + Collection listeners; + if (event.isPreload()) { + // Also fire error for load listeners + fireError(new ResourceLoadEvent(this, resource, false)); + listeners = preloadListeners.remove(resource); + } else { + listeners = loadListeners.remove(resource); + } + if (listeners != null && !listeners.isEmpty()) { + for (ResourceLoadListener listener : listeners) { + if (listener != null) { + listener.onError(event); + } + } + } + } + + private void fireLoad(ResourceLoadEvent event) { + String resource = event.getResourceUrl(); Collection listeners; - if (preload) { + if (event.isPreload()) { preloadedResources.add(resource); listeners = preloadListeners.remove(resource); } else { if (preloadListeners.containsKey(resource)) { // Also fire preload events for potential listeners - onResourceLoad(resource, true); + fireLoad(new ResourceLoadEvent(this, resource, true)); } preloadedResources.remove(resource); loadedResources.add(resource); listeners = loadListeners.remove(resource); } if (listeners != null && !listeners.isEmpty()) { - ResourceLoadEvent event = new ResourceLoadEvent(this, resource, - preload); for (ResourceLoadListener listener : listeners) { if (listener != null) { - listener.onResourceLoad(event); + listener.onLoad(event); } } } -- cgit v1.2.3 From 5e46aa3dd23c194a741c4e7c6c5821b6eb3d7a2d Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 28 Jun 2012 15:55:02 +0300 Subject: Support connector:// and use it for relative dependency urls (#9048) --- .../terminal/gwt/client/ApplicationConnection.java | 17 +-- .../gwt/server/AbstractApplicationServlet.java | 27 ++++- .../gwt/server/AbstractCommunicationManager.java | 115 ++++++++++++++++++++- 3 files changed, 148 insertions(+), 11 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index c6320f941b..8484d4abea 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -1621,7 +1621,7 @@ public class ApplicationConnection { ApplicationConfiguration.runWhenDependenciesLoaded(c); } - private static void loadStyleDependencies(JsArrayString dependencies) { + private void loadStyleDependencies(JsArrayString dependencies) { // Assuming no reason to interpret in a defined order ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { public void onLoad(ResourceLoadEvent event) { @@ -1637,12 +1637,13 @@ public class ApplicationConnection { }; ResourceLoader loader = ResourceLoader.get(); for (int i = 0; i < dependencies.length(); i++) { + String url = translateVaadinUri(dependencies.get(i)); ApplicationConfiguration.startDependencyLoading(); - loader.loadStylesheet(dependencies.get(i), resourceLoadListener); + loader.loadStylesheet(url, resourceLoadListener); } } - private static void loadScriptDependencies(final JsArrayString dependencies) { + private void loadScriptDependencies(final JsArrayString dependencies) { if (dependencies.length() == 0) { return; } @@ -1651,10 +1652,10 @@ public class ApplicationConnection { ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { public void onLoad(ResourceLoadEvent event) { if (dependencies.length() != 0) { + String url = translateVaadinUri(dependencies.shift()); ApplicationConfiguration.startDependencyLoading(); // Load next in chain (hopefully already preloaded) - event.getResourceLoader().loadScript(dependencies.shift(), - this); + event.getResourceLoader().loadScript(url, this); } // Call start for next before calling end for current ApplicationConfiguration.endDependencyLoading(); @@ -1670,8 +1671,9 @@ public class ApplicationConnection { ResourceLoader loader = ResourceLoader.get(); // Start chain by loading first + String url = translateVaadinUri(dependencies.shift()); ApplicationConfiguration.startDependencyLoading(); - loader.loadScript(dependencies.shift(), resourceLoadListener); + loader.loadScript(url, resourceLoadListener); // Preload all remaining for (int i = 0; i < dependencies.length(); i++) { @@ -2284,6 +2286,9 @@ public class ApplicationConnection { } if (uidlUri.startsWith("app://")) { uidlUri = getAppUri() + uidlUri.substring(6); + } else if (uidlUri.startsWith("connector://")) { + uidlUri = getAppUri() + "APP/CONNECTOR/" + + uidlUri.substring("connector://".length()); } return uidlUri; } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index f7e46a7ca9..6930961497 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -136,6 +136,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements static final String UPLOAD_URL_PREFIX = "APP/UPLOAD/"; + static final String CONNECTOR_RESOURCE_PREFIX = "/APP/CONNECTOR/"; + /** * Called by the servlet container to indicate to a servlet that the servlet * is being placed into service. @@ -396,6 +398,19 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements CommunicationManager applicationManager = webApplicationContext .getApplicationManager(application, this); + if (requestType == RequestType.CONNECTOR_RESOURCE) { + String pathInfo = getRequestPathInfo(request); + String resourceName = pathInfo + .substring(CONNECTOR_RESOURCE_PREFIX.length()); + + final String mimetype = getServletContext().getMimeType( + resourceName); + + applicationManager.serveConnectorResource(resourceName, + request, response, mimetype); + return; + } + /* Update browser information from the request */ webApplicationContext.getBrowser().updateRequestDetails(request); @@ -1250,12 +1265,14 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements } protected enum RequestType { - FILE_UPLOAD, BROWSER_DETAILS, UIDL, OTHER, STATIC_FILE, APPLICATION_RESOURCE; + FILE_UPLOAD, BROWSER_DETAILS, UIDL, OTHER, STATIC_FILE, APPLICATION_RESOURCE, CONNECTOR_RESOURCE; } protected RequestType getRequestType(HttpServletRequest request) { if (isFileUploadRequest(request)) { return RequestType.FILE_UPLOAD; + } else if (isConnectorResourceRequest(request)) { + return RequestType.CONNECTOR_RESOURCE; } else if (isBrowserDetailsRequest(request)) { return RequestType.BROWSER_DETAILS; } else if (isUIDLRequest(request)) { @@ -1276,6 +1293,14 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements && request.getParameter("browserDetails") != null; } + private boolean isConnectorResourceRequest(HttpServletRequest request) { + String path = getRequestPathInfo(request); + if (path != null && path.startsWith(CONNECTOR_RESOURCE_PREFIX)) { + return true; + } + return false; + } + private boolean isApplicationRequest(HttpServletRequest request) { String path = getRequestPathInfo(request); if (path != null && path.startsWith("/APP/")) { diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index c65b8947d6..4ee300edac 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -18,6 +18,8 @@ import java.io.StringWriter; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Type; +import java.net.URI; +import java.net.URISyntaxException; import java.security.GeneralSecurityException; import java.text.CharacterIterator; import java.text.DateFormat; @@ -25,7 +27,6 @@ import java.text.DateFormatSymbols; import java.text.SimpleDateFormat; import java.text.StringCharacterIterator; import java.util.ArrayList; -import java.util.Arrays; import java.util.Calendar; import java.util.Collection; import java.util.Collections; @@ -43,6 +44,8 @@ import java.util.UUID; import java.util.logging.Level; import java.util.logging.Logger; +import javax.servlet.http.HttpServletResponse; + import com.vaadin.Application; import com.vaadin.Application.SystemMessages; import com.vaadin.RootRequiresMoreInformationException; @@ -157,6 +160,8 @@ public abstract class AbstractCommunicationManager implements Serializable { private Connector highlightedConnector; + private Map> connectoResourceContexts = new HashMap>(); + /** * TODO New constructor - document me! * @@ -1177,13 +1182,16 @@ public abstract class AbstractCommunicationManager implements Serializable { for (Class class1 : newConnectorTypes) { JavaScript jsAnnotation = class1.getAnnotation(JavaScript.class); if (jsAnnotation != null) { - scriptDependencies.addAll(Arrays.asList(jsAnnotation.value())); + for (String resource : jsAnnotation.value()) { + scriptDependencies.add(registerResource(resource, class1)); + } } StyleSheet styleAnnotation = class1.getAnnotation(StyleSheet.class); if (styleAnnotation != null) { - styleDependencies - .addAll(Arrays.asList(styleAnnotation.value())); + for (String resource : styleAnnotation.value()) { + styleDependencies.add(registerResource(resource, class1)); + } } } @@ -1209,6 +1217,51 @@ public abstract class AbstractCommunicationManager implements Serializable { writePerformanceData(outWriter); } + private String registerResource(String resource, Class context) { + try { + URI uri = new URI(resource); + String protocol = uri.getScheme(); + + if ("connector".equals(protocol)) { + return registerContextResource(uri, context); + } + + if (protocol != null || uri.getHost() != null) { + return resource; + } + + String path = uri.getPath(); + if (path.startsWith("/")) { + return resource; + } + + // Default if just simple relative url + return registerContextResource(uri, context); + } catch (URISyntaxException e) { + getLogger().log(Level.WARNING, + "Could not parse resource url " + resource, e); + return resource; + } + } + + private String registerContextResource(URI uri, Class context) { + String path = uri.getPath(); + synchronized (connectoResourceContexts) { + // Connector resource + if (connectoResourceContexts.containsKey(path)) { + Class oldContext = connectoResourceContexts.get(path); + getLogger().warning( + "Resource " + path + " defined by both " + context + + " and " + oldContext + ". Resource from " + + oldContext + " will be used."); + } else { + connectoResourceContexts.put(path, context); + } + } + + return "connector://" + path; + } + /** * Adds the performance timing data (used by TestBench 3) to the UIDL * response. @@ -2332,6 +2385,60 @@ public abstract class AbstractCommunicationManager implements Serializable { return initialUIDL; } + public void serveConnectorResource(String resourceName, + WrappedRequest request, WrappedResponse response, String mimetype) + throws IOException { + if (resourceName.startsWith("/")) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); + return; + } + + Class context; + synchronized (connectoResourceContexts) { + context = connectoResourceContexts.get(resourceName); + } + + if (context == null) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); + return; + } + + InputStream in = context.getResourceAsStream(resourceName); + if (in == null) { + response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); + return; + } + OutputStream out = null; + try { + if (mimetype != null) { + response.setContentType(mimetype); + } + + out = response.getOutputStream(); + + final byte[] buffer = new byte[Constants.DEFAULT_BUFFER_SIZE]; + + int bytesRead = 0; + while ((bytesRead = in.read(buffer)) > 0) { + out.write(buffer, 0, bytesRead); + } + out.flush(); + } finally { + try { + in.close(); + } catch (Exception e) { + // Do nothing + } + if (out != null) { + try { + out.close(); + } catch (Exception e) { + // Do nothing + } + } + } + } + /** * Stream that extracts content from another stream until the boundary * string is encountered. -- cgit v1.2.3 From a90ab25c53099b21e81872aeded94bcb0fda9edf Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 Jun 2012 10:52:17 +0300 Subject: Formatted all source files --- src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java | 4 ++-- src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java | 1 - src/com/vaadin/tools/WidgetsetCompiler.java | 3 ++- src/com/vaadin/ui/Component.java | 4 ++-- .../com/vaadin/tests/server/component/table/TableSerialization.java | 3 ++- .../testbench/com/vaadin/tests/application/ThreadLocalInstances.java | 3 +-- tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java | 3 +-- 7 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java index bd62a759cb..f3a3aa3e83 100644 --- a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java +++ b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java @@ -238,8 +238,8 @@ public class JavaScriptConnectorHelper { return connector; } - return ConnectorMap.get(connector.getConnection()) - .getConnector(connectorId); + return ConnectorMap.get(connector.getConnection()).getConnector( + connectorId); } private void fireRpc(String iface, String method, diff --git a/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java index 0cccec6481..83ac97458e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/UnknownComponentConnector.java @@ -4,7 +4,6 @@ package com.vaadin.terminal.gwt.client.ui; - public class UnknownComponentConnector extends AbstractComponentConnector { @Override diff --git a/src/com/vaadin/tools/WidgetsetCompiler.java b/src/com/vaadin/tools/WidgetsetCompiler.java index 407f0e2387..987fd8f734 100644 --- a/src/com/vaadin/tools/WidgetsetCompiler.java +++ b/src/com/vaadin/tools/WidgetsetCompiler.java @@ -31,7 +31,8 @@ import com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder; * included in the classpath, as well as the gwt-dev-[platform].jar and other * relevant JARs. * - * @deprecated with Java 6, can use com.google.gwt.dev.Compiler directly (also in Eclipse plug-in etc.) + * @deprecated with Java 6, can use com.google.gwt.dev.Compiler directly (also + * in Eclipse plug-in etc.) */ @Deprecated public class WidgetsetCompiler { diff --git a/src/com/vaadin/ui/Component.java b/src/com/vaadin/ui/Component.java index 81e0319880..5d05f9d0f2 100644 --- a/src/com/vaadin/ui/Component.java +++ b/src/com/vaadin/ui/Component.java @@ -520,8 +520,8 @@ public interface Component extends ClientConnector, Sizeable, Serializable { *

* Getting a null value is often a problem in constructors of regular * components and in the initializers of custom composite components. A - * standard workaround is to use {@link Application#getCurrent()} - * to retrieve the application instance that the current request relates to. + * standard workaround is to use {@link Application#getCurrent()} to + * retrieve the application instance that the current request relates to. * Another way is to move the problematic initialization to * {@link #attach()}, as described in the documentation of the method. *

diff --git a/tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java b/tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java index 44dcd60fa5..ee6349093c 100644 --- a/tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java +++ b/tests/server-side/com/vaadin/tests/server/component/table/TableSerialization.java @@ -12,8 +12,9 @@ public class TableSerialization extends TestCase { Table t = new Table(); byte[] ser = SerializationUtils.serialize(t); Table t2 = (Table) SerializationUtils.deserialize(ser); - + } + public void testSerializationWithRowHeaders() { Table t = new Table(); t.setRowHeaderMode(Table.ROW_HEADER_MODE_EXPLICIT); diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java index fd65adf209..eeb866138b 100644 --- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java @@ -92,8 +92,7 @@ public class ThreadLocalInstances extends AbstractTestApplication { } private void reportCurrentStatus(String phase) { - reportStatus(phase, Application.getCurrent(), - Root.getCurrent()); + reportStatus(phase, Application.getCurrent(), Root.getCurrent()); } private void reportStatus(String phase, Application application, Root root) { diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java b/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java index 875d2b1df8..4355b66e5e 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java @@ -57,8 +57,7 @@ public abstract class AbstractTestRoot extends Root { protected abstract Integer getTicketNumber(); protected WebBrowser getBrowser() { - ApplicationContext context = Application.getCurrent() - .getContext(); + ApplicationContext context = Application.getCurrent().getContext(); if (context instanceof AbstractWebApplicationContext) { AbstractWebApplicationContext webContext = (AbstractWebApplicationContext) context; return webContext.getBrowser(); -- cgit v1.2.3 From 18ac8b25501e28cfcfc3271d2c6722a00fa01b98 Mon Sep 17 00:00:00 2001 From: Sami Viitanen Date: Thu, 28 Jun 2012 15:43:11 +0300 Subject: Tooltips are now handled by the connector and not the widget (#8425) --- .../terminal/gwt/client/ApplicationConnection.java | 99 +--------- .../terminal/gwt/client/ComponentConnector.java | 11 ++ .../vaadin/terminal/gwt/client/ConnectorMap.java | 38 ---- .../vaadin/terminal/gwt/client/TooltipInfo.java | 19 ++ src/com/vaadin/terminal/gwt/client/VCaption.java | 27 ++- src/com/vaadin/terminal/gwt/client/VTooltip.java | 214 +++++++++++++++------ .../gwt/client/ui/AbstractComponentConnector.java | 29 ++- .../terminal/gwt/client/ui/button/VButton.java | 5 - .../terminal/gwt/client/ui/checkbox/VCheckBox.java | 4 - .../gwt/client/ui/combobox/VFilterSelect.java | 22 +-- .../gwt/client/ui/datefield/VDateField.java | 11 -- .../ui/draganddropwrapper/VDragAndDropWrapper.java | 12 -- .../terminal/gwt/client/ui/embedded/VEmbedded.java | 2 - .../client/ui/formlayout/FormLayoutConnector.java | 35 ++++ .../gwt/client/ui/formlayout/VFormLayout.java | 21 +- .../terminal/gwt/client/ui/label/VLabel.java | 4 - .../vaadin/terminal/gwt/client/ui/link/VLink.java | 5 - .../gwt/client/ui/listselect/TooltipListBox.java | 41 ---- .../gwt/client/ui/listselect/VListSelect.java | 15 +- .../terminal/gwt/client/ui/menubar/VMenuBar.java | 30 --- .../gwt/client/ui/nativebutton/VNativeButton.java | 6 - .../gwt/client/ui/nativeselect/VNativeSelect.java | 16 +- .../AbstractOrderedLayoutConnector.java | 1 + .../gwt/client/ui/panel/PanelConnector.java | 1 + .../terminal/gwt/client/ui/panel/VPanel.java | 4 - .../gwt/client/ui/popupview/VPopupView.java | 10 - .../terminal/gwt/client/ui/slider/VSlider.java | 6 - .../gwt/client/ui/table/TableConnector.java | 25 +++ .../terminal/gwt/client/ui/table/VScrollTable.java | 70 +++---- .../gwt/client/ui/tabsheet/TabsheetConnector.java | 30 ++- .../terminal/gwt/client/ui/tabsheet/VTabsheet.java | 16 +- .../gwt/client/ui/textfield/VTextField.java | 5 - .../terminal/gwt/client/ui/tree/TreeConnector.java | 47 ++++- .../vaadin/terminal/gwt/client/ui/tree/VTree.java | 21 +- .../terminal/gwt/client/ui/upload/VUpload.java | 11 -- .../terminal/gwt/client/ui/window/VWindow.java | 5 - .../abstractcomponent/AllComponentTooltipTest.java | 50 +++++ .../components/abstractcomponent/TooltipTests.html | 77 ++++++++ .../components/abstractcomponent/TooltipTests.java | 97 ++++++++++ 39 files changed, 649 insertions(+), 493 deletions(-) delete mode 100644 src/com/vaadin/terminal/gwt/client/ui/listselect/TooltipListBox.java create mode 100644 tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java create mode 100644 tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html create mode 100644 tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 8484d4abea..da4dfa08dc 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -35,7 +35,6 @@ import com.google.gwt.regexp.shared.RegExp; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; -import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.HasWidgets; import com.google.gwt.user.client.ui.Widget; @@ -2323,57 +2322,8 @@ public class ApplicationConnection { /* Extended title handling */ - /** - * Data showed in tooltips are stored centrilized as it may be needed in - * varios place: caption, layouts, and in owner components themselves. - * - * Updating TooltipInfo is done in updateComponent method. - * - */ - public TooltipInfo getTooltipTitleInfo(ComponentConnector titleOwner, - Object key) { - if (null == titleOwner) { - return null; - } - return connectorMap.getTooltipInfo(titleOwner, key); - } - private final VTooltip tooltip = new VTooltip(this); - /** - * Component may want to delegate Tooltip handling to client. Layouts add - * Tooltip (description, errors) to caption, but some components may want - * them to appear one other elements too. - * - * Events wanted by this handler are same as in Tooltip.TOOLTIP_EVENTS - * - * @param event - * @param owner - */ - public void handleTooltipEvent(Event event, ComponentConnector owner) { - tooltip.handleTooltipEvent(event, owner, null); - - } - - /** - * Component may want to delegate Tooltip handling to client. Layouts add - * Tooltip (description, errors) to caption, but some components may want - * them to appear one other elements too. - * - * Events wanted by this handler are same as in Tooltip.TOOLTIP_EVENTS - * - * @param event - * @param owner - * @param key - * the key for tooltip if this is "additional" tooltip, null for - * components "main tooltip" - */ - public void handleTooltipEvent(Event event, ComponentConnector owner, - Object key) { - tooltip.handleTooltipEvent(event, owner, key); - - } - private ConnectorMap connectorMap = GWT.create(ConnectorMap.class); protected String getUidlSecurityKey() { @@ -2400,34 +2350,6 @@ public class ApplicationConnection { return rootConnector; } - /** - * If component has several tooltips in addition to the one provided by - * {@link com.vaadin.ui.AbstractComponent}, component can register them with - * this method. - *

- * Component must also pipe events to - * {@link #handleTooltipEvent(Event, ComponentConnector, Object)} method. - *

- * This method can also be used to deregister tooltips by using null as - * tooltip - * - * @param paintable - * Paintable "owning" this tooltip - * @param key - * key assosiated with given tooltip. Can be any object. For - * example a related dom element. Same key must be given for - * {@link #handleTooltipEvent(Event, ComponentConnector, Object)} - * method. - * - * @param tooltip - * the TooltipInfo object containing details shown in tooltip, - * null if deregistering tooltip - */ - public void registerTooltip(ComponentConnector paintable, Object key, - TooltipInfo tooltip) { - connectorMap.registerTooltip(paintable, key, tooltip); - } - /** * Gets the {@link ApplicationConfiguration} for the current application. * @@ -2510,15 +2432,15 @@ public class ApplicationConnection { // connectorMap.unregisterConnector(p); } + /** + * Get VTooltip instance related to application connection + * + * @return VTooltip instance + */ public VTooltip getVTooltip() { return tooltip; } - @Deprecated - public void handleTooltipEvent(Event event, Widget owner, Object key) { - handleTooltipEvent(event, getConnectorMap().getConnector(owner), key); - } - /** * Method provided for backwards compatibility. Duties previously done by * this method is now handled by the state change event handler in @@ -2546,17 +2468,6 @@ public class ApplicationConnection { return false; } - @Deprecated - public void handleTooltipEvent(Event event, Widget owner) { - handleTooltipEvent(event, getConnectorMap().getConnector(owner)); - - } - - @Deprecated - public void registerTooltip(Widget owner, Object key, TooltipInfo info) { - registerTooltip(getConnectorMap().getConnector(owner), key, info); - } - @Deprecated public boolean hasEventListeners(Widget widget, String eventIdentifier) { return hasEventListeners(getConnectorMap().getConnector(widget), diff --git a/src/com/vaadin/terminal/gwt/client/ComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ComponentConnector.java index 4e6a690a3c..95e9a4cf78 100644 --- a/src/com/vaadin/terminal/gwt/client/ComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ComponentConnector.java @@ -4,6 +4,7 @@ package com.vaadin.terminal.gwt.client; +import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.ui.Widget; /** @@ -104,4 +105,14 @@ public interface ComponentConnector extends ServerConnector { */ public void setWidgetEnabled(boolean widgetEnabled); + /** + * Gets the tooltip info for the given element. + * + * @param element + * The element to lookup a tooltip for + * @return The tooltip for the element or null if no tooltip is defined for + * this element. + */ + public TooltipInfo getTooltipInfo(Element element); + } diff --git a/src/com/vaadin/terminal/gwt/client/ConnectorMap.java b/src/com/vaadin/terminal/gwt/client/ConnectorMap.java index efb50b5e00..8bc4a4aacf 100644 --- a/src/com/vaadin/terminal/gwt/client/ConnectorMap.java +++ b/src/com/vaadin/terminal/gwt/client/ConnectorMap.java @@ -200,48 +200,10 @@ public class ConnectorMap { return idToConnector.size(); } - /** - * FIXME: Should be moved to VAbstractPaintableWidget - * - * @param paintable - * @return - */ - @Deprecated - public TooltipInfo getTooltipInfo(ComponentConnector paintable, Object key) { - ComponentDetail componentDetail = getComponentDetail(paintable); - if (componentDetail == null) { - return null; - } - return componentDetail.getTooltipInfo(key); - } - - @Deprecated - public TooltipInfo getWidgetTooltipInfo(Widget widget, Object key) { - ComponentConnector connector = getConnector(widget); - if (connector == null) { - return null; - } - return getTooltipInfo(connector, key); - } - public Collection getConnectors() { return Collections.unmodifiableCollection(idToConnector.values()); } - /** - * FIXME: Should not be here - * - * @param componentConnector - * @return - */ - @Deprecated - public void registerTooltip(ComponentConnector componentConnector, - Object key, TooltipInfo tooltip) { - getComponentDetail(componentConnector).putAdditionalTooltip(key, - tooltip); - - } - /** * Tests if the widget is the root widget of a {@link ComponentConnector}. * diff --git a/src/com/vaadin/terminal/gwt/client/TooltipInfo.java b/src/com/vaadin/terminal/gwt/client/TooltipInfo.java index fb33a56c56..1ad1ea43cd 100644 --- a/src/com/vaadin/terminal/gwt/client/TooltipInfo.java +++ b/src/com/vaadin/terminal/gwt/client/TooltipInfo.java @@ -16,6 +16,11 @@ public class TooltipInfo { setTitle(tooltip); } + public TooltipInfo(String tooltip, String errorMessage) { + setTitle(tooltip); + setErrorMessage(errorMessage); + } + public String getTitle() { return title; } @@ -32,4 +37,18 @@ public class TooltipInfo { errorMessageHtml = errorMessage; } + /** + * Checks is a message has been defined for the tooltip. + * + * @return true if title or error message is present, false if both are + * empty + */ + public boolean hasMessage() { + return (title != null && !title.isEmpty()) + || (errorMessageHtml != null && errorMessageHtml.isEmpty()); + } + + public boolean equals(TooltipInfo other) { + return (other != null && other.title == title && other.errorMessageHtml == errorMessageHtml); + } } diff --git a/src/com/vaadin/terminal/gwt/client/VCaption.java b/src/com/vaadin/terminal/gwt/client/VCaption.java index 6f3fcf2c3a..2f7ba87870 100644 --- a/src/com/vaadin/terminal/gwt/client/VCaption.java +++ b/src/com/vaadin/terminal/gwt/client/VCaption.java @@ -35,6 +35,8 @@ public class VCaption extends HTML { ICON, CAPTION, REQUIRED, ERROR } + private TooltipInfo tooltipInfo = null; + /** * Creates a caption that is not linked to a {@link ComponentConnector}. * @@ -74,8 +76,6 @@ public class VCaption extends HTML { } setStyleName(CLASSNAME); - sinkEvents(VTooltip.TOOLTIP_EVENTS); - } /** @@ -345,9 +345,6 @@ public class VCaption extends HTML { public void onBrowserEvent(Event event) { super.onBrowserEvent(event); final Element target = DOM.eventGetTarget(event); - if (client != null && owner != null && target != getElement()) { - client.handleTooltipEvent(event, owner); - } if (DOM.eventGetType(event) == Event.ONLOAD && icon.getElement() == target) { @@ -555,6 +552,26 @@ public class VCaption extends HTML { } } + /** + * Sets the tooltip that should be shown for the caption + * + * @param tooltipInfo + * The tooltip that should be shown or null if no tooltip should + * be shown + */ + public void setTooltipInfo(TooltipInfo tooltipInfo) { + this.tooltipInfo = tooltipInfo; + } + + /** + * Returns the tooltip that should be shown for the caption + * + * @return The tooltip to show or null if no tooltip should be shown + */ + public TooltipInfo getTooltipInfo() { + return tooltipInfo; + } + protected Element getTextElement() { return captionText; } diff --git a/src/com/vaadin/terminal/gwt/client/VTooltip.java b/src/com/vaadin/terminal/gwt/client/VTooltip.java index 70f4a0de0a..7fd3a3238b 100644 --- a/src/com/vaadin/terminal/gwt/client/VTooltip.java +++ b/src/com/vaadin/terminal/gwt/client/VTooltip.java @@ -3,12 +3,19 @@ */ package com.vaadin.terminal.gwt.client; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.event.dom.client.KeyDownEvent; +import com.google.gwt.event.dom.client.KeyDownHandler; +import com.google.gwt.event.dom.client.MouseMoveEvent; +import com.google.gwt.event.dom.client.MouseMoveHandler; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ui.VOverlay; /** @@ -27,15 +34,12 @@ public class VTooltip extends VOverlay { private static final int QUICK_OPEN_DELAY = 100; VErrorMessage em = new VErrorMessage(); Element description = DOM.createDiv(); - private ComponentConnector tooltipOwner; private boolean closing = false; private boolean opening = false; private ApplicationConnection ac; // Open next tooltip faster. Disabled after 2 sec of showTooltip-silence. private boolean justClosed = false; - // If this is "additional" tooltip, this field contains the key for it - private Object tooltipKey; public VTooltip(ApplicationConnection client) { super(false, false, true); @@ -115,51 +119,30 @@ public class VTooltip extends VOverlay { } } - public void showTooltip(ComponentConnector owner, Event event, Object key) { - if (closing && tooltipOwner == owner && tooltipKey == key) { - // return to same tooltip, cancel closing - closeTimer.cancel(); - closing = false; - justClosedTimer.cancel(); - justClosed = false; - return; - } + private void showTooltip() { - if (closing) { + // Close current tooltip + if (isShowing()) { closeNow(); } - updatePosition(event); - - if (opening) { - showTimer.cancel(); - } - tooltipOwner = owner; - tooltipKey = key; - // Schedule timer for showing the tooltip according to if it was // recently closed or not. - if (justClosed) { - showTimer.schedule(QUICK_OPEN_DELAY); - } else { - showTimer.schedule(OPEN_DELAY); - } + int timeout = justClosed ? QUICK_OPEN_DELAY : OPEN_DELAY; + showTimer.schedule(timeout); opening = true; } private void closeNow() { - if (closing) { - hide(); - tooltipOwner = null; - setWidth(""); - closing = false; - } + hide(); + setWidth(""); + closing = false; } private Timer showTimer = new Timer() { @Override public void run() { - TooltipInfo info = ac.getTooltipTitleInfo(tooltipOwner, tooltipKey); + TooltipInfo info = tooltipEventHandler.getTooltipInfo(); if (null != info) { show(info); } @@ -187,7 +170,6 @@ public class VTooltip extends VOverlay { if (opening) { showTimer.cancel(); opening = false; - tooltipOwner = null; } if (!isAttached()) { return; @@ -209,24 +191,6 @@ public class VTooltip extends VOverlay { public void updatePosition(Event event) { tooltipEventMouseX = DOM.eventGetClientX(event); tooltipEventMouseY = DOM.eventGetClientY(event); - - } - - public void handleTooltipEvent(Event event, ComponentConnector owner, - Object key) { - final int type = DOM.eventGetType(event); - if ((VTooltip.TOOLTIP_EVENTS & type) == type) { - if (type == Event.ONMOUSEOVER) { - showTooltip(owner, event, key); - } else if (type == Event.ONMOUSEMOVE) { - updatePosition(event); - } else { - hideTooltip(); - } - } else { - // non-tooltip event, hide tooltip - hideTooltip(); - } } @Override @@ -235,17 +199,149 @@ public class VTooltip extends VOverlay { // cancel closing event if tooltip is mouseovered; the user might want // to scroll of cut&paste - switch (type) { - case Event.ONMOUSEOVER: + if (type == Event.ONMOUSEOVER) { + // Cancel closing so tooltip stays open and user can copy paste the + // tooltip closeTimer.cancel(); closing = false; - break; - case Event.ONMOUSEOUT: + } + } + + /** + * Replace current open tooltip with new content + */ + public void replaceCurrentTooltip() { + if (closing) { + closeTimer.cancel(); + closeNow(); + } + + TooltipInfo info = tooltipEventHandler.getTooltipInfo(); + if (null != info) { + show(info); + } + opening = false; + } + + private class TooltipEventHandler implements MouseMoveHandler, + ClickHandler, KeyDownHandler { + + /** + * Current element hovered + */ + private com.google.gwt.dom.client.Element currentElement = null; + + /** + * Current tooltip active + */ + private TooltipInfo currentTooltipInfo = null; + + /** + * Get current active tooltip information + * + * @return Current active tooltip information or null + */ + public TooltipInfo getTooltipInfo() { + return currentTooltipInfo; + } + + /** + * Locate connector and it's tooltip for given element + * + * @param element + * Element used in search + * @return true if connector and tooltip found + */ + private boolean resolveConnector(Element element) { + + ComponentConnector connector = Util.getConnectorForElement(ac, ac + .getRootConnector().getWidget(), element); + + // Try to find first connector with proper tooltip info + TooltipInfo info = null; + while (connector != null) { + + info = connector.getTooltipInfo(element); + + if (info != null && info.hasMessage()) { + break; + } + + if (!(connector.getParent() instanceof ComponentConnector)) { + connector = null; + info = null; + break; + } + connector = (ComponentConnector) connector.getParent(); + } + + if (connector != null && info != null) { + currentTooltipInfo = info; + return true; + } + + return false; + } + + /** + * Handle hide event + * + * @param event + * Event causing hide + */ + private void handleHideEvent() { hideTooltip(); - break; - default: - // NOP + currentTooltipInfo = null; + } + + public void onMouseMove(MouseMoveEvent mme) { + Event event = Event.as(mme.getNativeEvent()); + com.google.gwt.dom.client.Element element = Element.as(event + .getEventTarget()); + + // We can ignore move event if it's handled by move or over already + if (currentElement == element) { + return; + } + currentElement = element; + + boolean connectorAndTooltipFound = resolveConnector((com.google.gwt.user.client.Element) element); + if (!connectorAndTooltipFound) { + if (isShowing()) { + handleHideEvent(); + } else { + currentTooltipInfo = null; + } + } else { + updatePosition(event); + if (isShowing()) { + replaceCurrentTooltip(); + } else { + showTooltip(); + } + } + } + + public void onClick(ClickEvent event) { + handleHideEvent(); + } + + public void onKeyDown(KeyDownEvent event) { + handleHideEvent(); } } + private final TooltipEventHandler tooltipEventHandler = new TooltipEventHandler(); + + /** + * Connects DOM handlers to widget that are needed for tooltip presentation. + * + * @param widget + * Widget which DOM handlers are connected + */ + public void connectHandlersToWidget(Widget widget) { + widget.addDomHandler(tooltipEventHandler, MouseMoveEvent.getType()); + widget.addDomHandler(tooltipEventHandler, ClickEvent.getType()); + widget.addDomHandler(tooltipEventHandler, KeyDownEvent.getType()); + } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java index f0b9d518ca..2f55cc4d16 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java @@ -5,6 +5,7 @@ package com.vaadin.terminal.gwt.client.ui; import java.util.Set; +import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.ui.Focusable; import com.google.gwt.user.client.ui.HasEnabled; import com.google.gwt.user.client.ui.Widget; @@ -37,6 +38,12 @@ public abstract class AbstractComponentConnector extends AbstractConnector public AbstractComponentConnector() { } + @Override + protected void init() { + super.init(); + getConnection().getVTooltip().connectHandlersToWidget(getWidget()); + } + /** * Creates and returns the widget for this VPaintableWidget. This method * should only be called once when initializing the paintable. @@ -99,16 +106,6 @@ public abstract class AbstractComponentConnector extends AbstractConnector String styleName = getStyleNames(getWidget().getStylePrimaryName()); getWidget().setStyleName(styleName); - // Update tooltip - TooltipInfo tooltipInfo = paintableMap.getTooltipInfo(this, null); - if (getState().hasDescription()) { - tooltipInfo.setTitle(getState().getDescription()); - } else { - tooltipInfo.setTitle(null); - } - // add error info to tooltip if present - tooltipInfo.setErrorMessage(getState().getErrorMessage()); - // Set captions if (delegateCaptionHandling()) { ServerConnector parent = getParent(); @@ -315,4 +312,16 @@ public abstract class AbstractComponentConnector extends AbstractConnector + ") has been unregistered. Widget was removed."); } } + + /* + * (non-Javadoc) + * + * @see + * com.vaadin.terminal.gwt.client.ComponentConnector#getTooltipInfo(com. + * google.gwt.dom.client.Element) + */ + public TooltipInfo getTooltipInfo(Element element) { + return new TooltipInfo(getState().getDescription(), getState() + .getErrorMessage()); + } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java b/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java index 0cd8bc54f4..bb3d8e2985 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java @@ -18,7 +18,6 @@ import com.google.gwt.user.client.ui.FocusWidget; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Icon; public class VButton extends FocusWidget implements ClickHandler { @@ -90,7 +89,6 @@ public class VButton extends FocusWidget implements ClickHandler { setTabIndex(0); sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS | Event.KEYEVENTS); - sinkEvents(VTooltip.TOOLTIP_EVENTS); setStyleName(CLASSNAME); @@ -128,9 +126,6 @@ public class VButton extends FocusWidget implements ClickHandler { * -onload event handler added (for icon handling) */ public void onBrowserEvent(Event event) { - if (client != null) { - client.handleTooltipEvent(event, this); - } if (DOM.eventGetType(event) == Event.ONLOAD) { Util.notifyParentOfSizeChange(this, true); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/checkbox/VCheckBox.java b/src/com/vaadin/terminal/gwt/client/ui/checkbox/VCheckBox.java index fd90796ea5..a6eec2de8a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/checkbox/VCheckBox.java +++ b/src/com/vaadin/terminal/gwt/client/ui/checkbox/VCheckBox.java @@ -31,7 +31,6 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements public VCheckBox() { setStyleName(CLASSNAME); - sinkEvents(VTooltip.TOOLTIP_EVENTS); Element el = DOM.getFirstChild(getElement()); while (el != null) { DOM.sinkEvents(el, @@ -53,9 +52,6 @@ public class VCheckBox extends com.google.gwt.user.client.ui.CheckBox implements if (event.getTypeInt() == Event.ONLOAD) { Util.notifyParentOfSizeChange(this, true); } - if (client != null) { - client.handleTooltipEvent(event, this); - } } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java index 8c5d521445..9831001024 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java @@ -54,7 +54,6 @@ import com.vaadin.terminal.gwt.client.Focusable; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.VConsole; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Field; import com.vaadin.terminal.gwt.client.ui.SubPartAware; import com.vaadin.terminal.gwt.client.ui.VLazyExecutor; @@ -824,21 +823,6 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * The text box where the filter is written */ protected final TextBox tb = new TextBox() { - /* - * (non-Javadoc) - * - * @see - * com.google.gwt.user.client.ui.TextBoxBase#onBrowserEvent(com.google - * .gwt.user.client.Event) - */ - - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - if (client != null) { - client.handleTooltipEvent(event, VFilterSelect.this); - } - } // Overridden to avoid selecting text when text input is disabled @Override @@ -869,9 +853,6 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, @Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); - if (client != null) { - client.handleTooltipEvent(event, VFilterSelect.this); - } /* * Prevent the keyboard focus from leaving the textfield by @@ -972,8 +953,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, } }); - tb.sinkEvents(VTooltip.TOOLTIP_EVENTS); - popupOpener.sinkEvents(VTooltip.TOOLTIP_EVENTS | Event.ONMOUSEDOWN); + popupOpener.sinkEvents(Event.ONMOUSEDOWN); panel.add(tb); panel.add(popupOpener); initWidget(panel); diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateField.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateField.java index d169b1b47e..614c4febdd 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateField.java @@ -6,11 +6,9 @@ package com.vaadin.terminal.gwt.client.ui.datefield; import java.util.Date; -import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.FlowPanel; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.DateTimeService; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Field; public class VDateField extends FlowPanel implements Field { @@ -66,15 +64,6 @@ public class VDateField extends FlowPanel implements Field { public VDateField() { setStyleName(CLASSNAME); dts = new DateTimeService(); - sinkEvents(VTooltip.TOOLTIP_EVENTS); - } - - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - if (client != null) { - client.handleTooltipEvent(event, this); - } } /* diff --git a/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java b/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java index 4c36e92bbb..b1fffc8355 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java +++ b/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java @@ -29,7 +29,6 @@ import com.vaadin.terminal.gwt.client.LayoutManager; import com.vaadin.terminal.gwt.client.MouseEventDetailsBuilder; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.VConsole; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ValueMap; import com.vaadin.terminal.gwt.client.ui.customcomponent.VCustomComponent; import com.vaadin.terminal.gwt.client.ui.dd.DDUtil; @@ -64,7 +63,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements public VDragAndDropWrapper() { super(); - sinkEvents(VTooltip.TOOLTIP_EVENTS); hookHtml5Events(getElement()); setStyleName(CLASSNAME); @@ -92,16 +90,6 @@ public class VDragAndDropWrapper extends VCustomComponent implements sinkEvents(Event.TOUCHEVENTS); } - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - - if (hasTooltip && client != null) { - // Override child tooltips if the wrapper has a tooltip defined - client.handleTooltipEvent(event, this); - } - } - /** * Starts a drag and drop operation from mousedown or touchstart event if * required conditions are met. diff --git a/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java b/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java index 203e7362f3..5edd31174d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java +++ b/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java @@ -232,8 +232,6 @@ public class VEmbedded extends HTML { VConsole.log("Embeddable onload"); Util.notifyParentOfSizeChange(this, true); } - - client.handleTooltipEvent(event, this); } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java index ca21947a6c..c08651ded1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java @@ -3,9 +3,12 @@ */ package com.vaadin.terminal.gwt.client.ui.formlayout; +import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ComponentConnector; import com.vaadin.terminal.gwt.client.ConnectorHierarchyChangeEvent; +import com.vaadin.terminal.gwt.client.TooltipInfo; +import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; import com.vaadin.terminal.gwt.client.ui.AbstractFieldConnector; import com.vaadin.terminal.gwt.client.ui.AbstractLayoutConnector; @@ -96,4 +99,36 @@ public class FormLayoutConnector extends AbstractLayoutConnector { return (VFormLayout) super.getWidget(); } + @Override + public TooltipInfo getTooltipInfo(Element element) { + TooltipInfo info = null; + + if (element != getWidget().getElement()) { + Object node = Util.findWidget( + (com.google.gwt.user.client.Element) element, + VFormLayout.Caption.class); + + if (node != null) { + VFormLayout.Caption caption = (VFormLayout.Caption) node; + info = caption.getOwner().getTooltipInfo(element); + } else { + + node = Util.findWidget( + (com.google.gwt.user.client.Element) element, + VFormLayout.ErrorFlag.class); + + if (node != null) { + VFormLayout.ErrorFlag flag = (VFormLayout.ErrorFlag) node; + info = flag.getOwner().getTooltipInfo(element); + } + } + } + + if (info == null) { + info = super.getTooltipInfo(element); + } + + return info; + } + } diff --git a/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java b/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java index 8a859c409c..1a161c529d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java @@ -12,7 +12,6 @@ import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; -import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.SimplePanel; @@ -215,8 +214,6 @@ public class VFormLayout extends SimplePanel { public Caption(ComponentConnector component) { super(); owner = component; - - sinkEvents(VTooltip.TOOLTIP_EVENTS); } private void setStyles(String[] styles) { @@ -324,12 +321,6 @@ public class VFormLayout extends SimplePanel { public ComponentConnector getOwner() { return owner; } - - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - owner.getConnection().handleTooltipEvent(event, owner); - } } class ErrorFlag extends HTML { @@ -345,6 +336,10 @@ public class VFormLayout extends SimplePanel { this.owner = owner; } + public ComponentConnector getOwner() { + return owner; + } + public void updateError(String errorMessage, boolean hideErrors) { boolean showError = null != errorMessage; if (hideErrors) { @@ -366,13 +361,5 @@ public class VFormLayout extends SimplePanel { } } - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - if (owner != null) { - owner.getConnection().handleTooltipEvent(event, owner); - } - } - } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/label/VLabel.java b/src/com/vaadin/terminal/gwt/client/ui/label/VLabel.java index f47b8437b7..f0c170c6b0 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/label/VLabel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/label/VLabel.java @@ -28,7 +28,6 @@ public class VLabel extends HTML { public VLabel(String text) { super(text); setStyleName(CLASSNAME); - sinkEvents(VTooltip.TOOLTIP_EVENTS); } @Override @@ -39,9 +38,6 @@ public class VLabel extends HTML { event.stopPropagation(); return; } - if (connection != null) { - connection.handleTooltipEvent(event, this); - } } @Override diff --git a/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java b/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java index 68fe5d9292..bef7943e3f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java +++ b/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java @@ -13,7 +13,6 @@ import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.HTML; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Icon; public class VLink extends HTML implements ClickHandler { @@ -51,7 +50,6 @@ public class VLink extends HTML implements ClickHandler { getElement().appendChild(anchor); anchor.appendChild(captionElement); addClickHandler(this); - sinkEvents(VTooltip.TOOLTIP_EVENTS); setStyleName(CLASSNAME); } @@ -101,9 +99,6 @@ public class VLink extends HTML implements ClickHandler { if (event.getTypeInt() == Event.ONLOAD) { Util.notifyParentOfSizeChange(this, true); } - if (client != null) { - client.handleTooltipEvent(event, this); - } if (target == captionElement || target == anchor || (icon != null && target == icon.getElement())) { super.onBrowserEvent(event); diff --git a/src/com/vaadin/terminal/gwt/client/ui/listselect/TooltipListBox.java b/src/com/vaadin/terminal/gwt/client/ui/listselect/TooltipListBox.java deleted file mode 100644 index abecd844da..0000000000 --- a/src/com/vaadin/terminal/gwt/client/ui/listselect/TooltipListBox.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.terminal.gwt.client.ui.listselect; - -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.ui.ListBox; -import com.google.gwt.user.client.ui.Widget; -import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.VTooltip; - -/** - * Extended ListBox to listen tooltip events and forward them to generic - * handler. - */ -public class TooltipListBox extends ListBox { - private ApplicationConnection client; - private Widget widget; - - public TooltipListBox(boolean isMultiselect) { - super(isMultiselect); - sinkEvents(VTooltip.TOOLTIP_EVENTS); - } - - public void setClient(ApplicationConnection client) { - this.client = client; - } - - public void setSelect(Widget widget) { - this.widget = widget; - } - - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - if (client != null) { - client.handleTooltipEvent(event, widget); - } - } - -} \ No newline at end of file diff --git a/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java b/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java index e338897841..1b1c2c44e3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.Iterator; import com.google.gwt.event.dom.client.ChangeEvent; +import com.google.gwt.user.client.ui.ListBox; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.ui.optiongroup.VOptionGroupBase; @@ -17,23 +18,25 @@ public class VListSelect extends VOptionGroupBase { private static final int VISIBLE_COUNT = 10; - protected TooltipListBox select; + protected ListBox select; private int lastSelectedIndex = -1; public VListSelect() { - super(new TooltipListBox(true), CLASSNAME); - select = (TooltipListBox) optionsContainer; - select.setSelect(this); + super(new ListBox(true), CLASSNAME); + select = getOptionsContainer(); select.addChangeHandler(this); select.addClickHandler(this); select.setStyleName(CLASSNAME + "-select"); select.setVisibleItemCount(VISIBLE_COUNT); } + protected ListBox getOptionsContainer() { + return (ListBox) optionsContainer; + } + @Override protected void buildOptions(UIDL uidl) { - select.setClient(client); select.setMultipleSelect(isMultiselect()); select.setEnabled(!isDisabled() && !isReadonly()); select.clear(); @@ -99,7 +102,7 @@ public class VListSelect extends VOptionGroupBase { @Override protected void setTabIndex(int tabIndex) { - ((TooltipListBox) optionsContainer).setTabIndex(tabIndex); + getOptionsContainer().setTabIndex(tabIndex); } public void focus() { diff --git a/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java index e48483cb02..821fa5032c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java @@ -33,10 +33,8 @@ import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.LayoutManager; -import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Icon; import com.vaadin.terminal.gwt.client.ui.SimpleFocusablePanel; import com.vaadin.terminal.gwt.client.ui.SubPartAware; @@ -140,8 +138,6 @@ public class VMenuBar extends SimpleFocusablePanel implements sinkEvents(Event.ONCLICK | Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONLOAD); - - sinkEvents(VTooltip.TOOLTIP_EVENTS); } @Override @@ -340,15 +336,6 @@ public class VMenuBar extends SimpleFocusablePanel implements } } - // Handle tooltips - if (targetItem == null && client != null) { - // Handle root menubar tooltips - client.handleTooltipEvent(e, this); - } else if (targetItem != null) { - // Handle item tooltips - targetItem.onBrowserEvent(e); - } - if (targetItem != null) { switch (DOM.eventGetType(e)) { @@ -761,7 +748,6 @@ public class VMenuBar extends SimpleFocusablePanel implements setSelected(false); setStyleName(CLASSNAME + "-menuitem"); - sinkEvents(VTooltip.TOOLTIP_EVENTS); } public void setSelected(boolean selected) { @@ -917,22 +903,6 @@ public class VMenuBar extends SimpleFocusablePanel implements addStyleDependentName(itemStyle); } - if (uidl.hasAttribute(ATTRIBUTE_ITEM_DESCRIPTION)) { - String description = uidl - .getStringAttribute(ATTRIBUTE_ITEM_DESCRIPTION); - TooltipInfo info = new TooltipInfo(description); - - VMenuBar root = findRootMenu(); - client.registerTooltip(root, this, info); - } - } - - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - if (client != null) { - client.handleTooltipEvent(event, findRootMenu(), this); - } } private VMenuBar findRootMenu() { diff --git a/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java b/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java index dd6e741126..e5a2e1253c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java @@ -15,7 +15,6 @@ import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.MouseEventDetails; import com.vaadin.terminal.gwt.client.MouseEventDetailsBuilder; import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Icon; import com.vaadin.terminal.gwt.client.ui.button.ButtonServerRpc; @@ -54,7 +53,6 @@ public class VNativeButton extends Button implements ClickHandler { addClickHandler(this); - sinkEvents(VTooltip.TOOLTIP_EVENTS); sinkEvents(Event.ONMOUSEDOWN); sinkEvents(Event.ONMOUSEUP); } @@ -87,10 +85,6 @@ public class VNativeButton extends Button implements ClickHandler { } clickPending = false; } - - if (client != null) { - client.handleTooltipEvent(event, this); - } } @Override diff --git a/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java b/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java index 54f5e9aff5..cab23b1bc2 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java @@ -8,32 +8,34 @@ import java.util.ArrayList; import java.util.Iterator; import com.google.gwt.event.dom.client.ChangeEvent; +import com.google.gwt.user.client.ui.ListBox; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.ui.Field; -import com.vaadin.terminal.gwt.client.ui.listselect.TooltipListBox; import com.vaadin.terminal.gwt.client.ui.optiongroup.VOptionGroupBase; public class VNativeSelect extends VOptionGroupBase implements Field { public static final String CLASSNAME = "v-select"; - protected TooltipListBox select; + protected ListBox select; private boolean firstValueIsTemporaryNullItem = false; public VNativeSelect() { - super(new TooltipListBox(false), CLASSNAME); - select = (TooltipListBox) optionsContainer; - select.setSelect(this); + super(new ListBox(false), CLASSNAME); + select = getOptionsContainer(); select.setVisibleItemCount(1); select.addChangeHandler(this); select.setStyleName(CLASSNAME + "-select"); } + protected ListBox getOptionsContainer() { + return (ListBox) optionsContainer; + } + @Override protected void buildOptions(UIDL uidl) { - select.setClient(client); select.setEnabled(!isDisabled() && !isReadonly()); select.clear(); firstValueIsTemporaryNullItem = false; @@ -103,7 +105,7 @@ public class VNativeSelect extends VOptionGroupBase implements Field { @Override protected void setTabIndex(int tabIndex) { - ((TooltipListBox) optionsContainer).setTabIndex(tabIndex); + getOptionsContainer().setTabIndex(tabIndex); } public void focus() { diff --git a/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java index 9a89553fd2..7c748df29d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java @@ -48,6 +48,7 @@ public abstract class AbstractOrderedLayoutConnector extends @Override public void init() { + super.init(); rpc = RpcProxy.create(AbstractOrderedLayoutServerRpc.class, this); getLayoutManager().registerDependency(this, getWidget().spacingMeasureElement); diff --git a/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java index d9096526f3..ea7ffda9db 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java @@ -46,6 +46,7 @@ public class PanelConnector extends AbstractComponentContainerConnector @Override public void init() { + super.init(); rpc = RpcProxy.create(PanelServerRpc.class, this); VPanel panel = getWidget(); LayoutManager layoutManager = getLayoutManager(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java b/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java index 6a06367acd..d56a82c46b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java @@ -167,10 +167,6 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, client.updateVariable(id, "scrollTop", scrollTop, false); client.updateVariable(id, "scrollLeft", scrollLeft, false); } - } else if (captionNode.isOrHasChild(target)) { - if (client != null) { - client.handleTooltipEvent(event, this); - } } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java b/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java index da48975726..c8a0222ee2 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java @@ -26,7 +26,6 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.ComponentConnector; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.VCaptionWrapper; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.VOverlay; import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea; @@ -73,7 +72,6 @@ public class VPopupView extends HTML { }); popup.setAnimationEnabled(true); - sinkEvents(VTooltip.TOOLTIP_EVENTS); } /** @@ -337,12 +335,4 @@ public class VPopupView extends HTML { }// class CustomPopup - @Override - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - if (client != null) { - client.handleTooltipEvent(event, this); - } - } - }// class VPopupView diff --git a/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java b/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java index 5c7ee7a784..e5282dc45e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java +++ b/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java @@ -18,7 +18,6 @@ import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.ContainerResizedListener; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.VConsole; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Field; import com.vaadin.terminal.gwt.client.ui.SimpleFocusablePanel; import com.vaadin.terminal.gwt.client.ui.VLazyExecutor; @@ -114,8 +113,6 @@ public class VSlider extends SimpleFocusablePanel implements Field, feedbackPopup.addStyleName(CLASSNAME + "-feedback"); feedbackPopup.setWidget(feedback); - - sinkEvents(VTooltip.TOOLTIP_EVENTS); } void setFeedbackValue(double value) { @@ -291,9 +288,6 @@ public class VSlider extends SimpleFocusablePanel implements Field, event.preventDefault(); // avoid simulated events event.stopPropagation(); } - if (client != null) { - client.handleTooltipEvent(event, this); - } } private void processMouseWheelEvent(final Event event) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java b/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java index ada0f2424f..ab867ea045 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java @@ -7,6 +7,7 @@ import java.util.Iterator; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; +import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.Position; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.Widget; @@ -17,6 +18,7 @@ import com.vaadin.terminal.gwt.client.ComponentConnector; import com.vaadin.terminal.gwt.client.DirectionalManagedLayout; import com.vaadin.terminal.gwt.client.Paintable; import com.vaadin.terminal.gwt.client.ServerConnector; +import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.ui.AbstractComponentContainerConnector; @@ -328,4 +330,27 @@ public class TableConnector extends AbstractComponentContainerConnector } } + @Override + public TooltipInfo getTooltipInfo(Element element) { + + TooltipInfo info = null; + + if (element != getWidget().getElement()) { + Object node = Util.findWidget( + (com.google.gwt.user.client.Element) element, + VScrollTableRow.class); + + if (node != null) { + VScrollTableRow row = (VScrollTableRow) node; + info = row.getTooltip(element); + } + } + + if (info == null) { + info = super.getTooltipInfo(element); + } + + return info; + } + } diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java index c4a57f5c8b..b5f10e68ec 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java @@ -11,6 +11,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import java.util.List; +import java.util.Map; import java.util.Set; import com.google.gwt.core.client.JavaScriptObject; @@ -4194,14 +4195,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private void unlinkRowAtActualIndex(int index) { final VScrollTableRow toBeRemoved = (VScrollTableRow) renderedRows .get(index); - // Unregister row tooltip - client.registerTooltip(VScrollTable.this, toBeRemoved.getElement(), - null); - for (int i = 0; i < toBeRemoved.getElement().getChildCount(); i++) { - // Unregister cell tooltips - Element td = toBeRemoved.getElement().getChild(i).cast(); - client.registerTooltip(VScrollTable.this, td, null); - } tBodyElement.removeChild(toBeRemoved.getElement()); orphan(toBeRemoved); renderedRows.remove(index); @@ -4423,6 +4416,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private Timer dragTouchTimeout; private int touchStartY; private int touchStartX; + private TooltipInfo tooltipInfo = null; + private Map cellToolTips = new HashMap(); private boolean isDragging = false; private VScrollTableRow(int rowKey) { @@ -4450,11 +4445,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, String rowDescription = uidl.getStringAttribute("rowdescr"); if (rowDescription != null && !rowDescription.equals("")) { - TooltipInfo info = new TooltipInfo(rowDescription); - client.registerTooltip(VScrollTable.this, rowElement, info); + tooltipInfo = new TooltipInfo(rowDescription); } else { - // Remove possibly previously set tooltip - client.registerTooltip(VScrollTable.this, rowElement, null); + tooltipInfo = null; } tHead.getColumnAlignments(); @@ -4480,6 +4473,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } } + public TooltipInfo getTooltipInfo() { + return tooltipInfo; + } + /** * Add a dummy row, used for measurements if Table is empty. */ @@ -4665,10 +4662,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (description != null && !description.equals("")) { TooltipInfo info = new TooltipInfo(description); - client.registerTooltip(VScrollTable.this, td, info); + cellToolTips.put(td, info); } else { - // Remove possibly previously set tooltip - client.registerTooltip(VScrollTable.this, td, null); + cellToolTips.remove(td); } td.appendChild(container); @@ -4776,39 +4772,22 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return true; } - private void handleTooltips(final Event event, Element target) { + public TooltipInfo getTooltip( + com.google.gwt.dom.client.Element target) { + + TooltipInfo info = null; + if (target.hasTagName("TD")) { - // Table cell (td) - Element container = target.getFirstChildElement().cast(); - Element widget = container.getFirstChildElement().cast(); - - boolean containsWidget = false; - for (Widget w : childWidgets) { - if (widget == w.getElement()) { - containsWidget = true; - break; - } - } - if (!containsWidget) { - // Only text nodes has tooltips - if (ConnectorMap.get(client).getWidgetTooltipInfo( - VScrollTable.this, target) != null) { - // Cell has description, use it - client.handleTooltipEvent(event, VScrollTable.this, - target); - } else { - // Cell might have row description, use row - // description - client.handleTooltipEvent(event, VScrollTable.this, - target.getParentElement()); - } - } + TableCellElement td = (TableCellElement) target.cast(); + info = cellToolTips.get(td); + } - } else { - // Table row (tr) - client.handleTooltipEvent(event, VScrollTable.this, target); + if (info == null) { + info = tooltipInfo; } + + return info; } /** @@ -4953,9 +4932,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } boolean targetCellOrRowFound = targetTdOrTr != null; - if (targetCellOrRowFound) { - handleTooltips(event, targetTdOrTr); - } switch (type) { case Event.ONDBLCLICK: diff --git a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java index 08d4679dc5..51a7801f91 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java @@ -3,12 +3,13 @@ */ package com.vaadin.terminal.gwt.client.ui.tabsheet; -import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.ComponentConnector; +import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; +import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.ui.Connect; import com.vaadin.terminal.gwt.client.ui.SimpleManagedLayout; import com.vaadin.terminal.gwt.client.ui.layout.MayScrollChildren; @@ -97,4 +98,29 @@ public class TabsheetConnector extends TabsheetBaseConnector implements } + @Override + public TooltipInfo getTooltipInfo(Element element) { + + TooltipInfo info = null; + + // Find a tooltip for the tab, if the element is a tab + if (element != getWidget().getElement()) { + Object node = Util.findWidget( + (com.google.gwt.user.client.Element) element, + VTabsheet.TabCaption.class); + + if (node != null) { + VTabsheet.TabCaption caption = (VTabsheet.TabCaption) node; + info = caption.getTooltipInfo(); + } + } + + // If not tab tooltip was found, use the default + if (info == null) { + info = super.getTooltipInfo(element); + } + + return info; + } + } diff --git a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java index aba5a41f9a..24ea3b2d38 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java @@ -233,7 +233,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } } - private static class TabCaption extends VCaption { + public static class TabCaption extends VCaption { private boolean closable = false; private Element closeButton; @@ -248,16 +248,11 @@ public class VTabsheet extends VTabsheetBase implements Focusable, public boolean updateCaption(UIDL uidl) { if (uidl.hasAttribute(TabsheetBaseConnector.ATTRIBUTE_TAB_DESCRIPTION)) { - TooltipInfo tooltipInfo = new TooltipInfo(); - tooltipInfo - .setTitle(uidl - .getStringAttribute(TabsheetBaseConnector.ATTRIBUTE_TAB_DESCRIPTION)); - tooltipInfo - .setErrorMessage(uidl - .getStringAttribute(TabsheetBaseConnector.ATTRIBUTE_TAB_ERROR_MESSAGE)); - client.registerTooltip(getTabsheet(), getElement(), tooltipInfo); + setTooltipInfo(new TooltipInfo( + uidl.getStringAttribute(TabsheetBaseConnector.ATTRIBUTE_TAB_DESCRIPTION), + uidl.getStringAttribute(TabsheetBaseConnector.ATTRIBUTE_TAB_ERROR_MESSAGE))); } else { - client.registerTooltip(getTabsheet(), getElement(), null); + setTooltipInfo(null); } // TODO need to call this instead of super because the caption does @@ -292,7 +287,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable, if (event.getTypeInt() == Event.ONLOAD) { getTabsheet().tabSizeMightHaveChanged(getTab()); } - client.handleTooltipEvent(event, getTabsheet(), getElement()); } public Tab getTab() { diff --git a/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java index aeae165f60..bd55c26a24 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java @@ -22,7 +22,6 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.EventId; import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Field; /** @@ -88,7 +87,6 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, } addFocusHandler(this); addBlurHandler(this); - sinkEvents(VTooltip.TOOLTIP_EVENTS); } /* @@ -107,9 +105,6 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, @Override public void onBrowserEvent(Event event) { super.onBrowserEvent(event); - if (client != null) { - client.handleTooltipEvent(event, this); - } if (listenTextChangeEvents && (event.getTypeInt() & TEXTCHANGE_EVENTS) == event diff --git a/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java b/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java index e4afa32143..3f96a61bf3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java @@ -3,14 +3,18 @@ */ package com.vaadin.terminal.gwt.client.ui.tree; +import java.util.HashMap; import java.util.Iterator; +import java.util.Map; +import com.google.gwt.dom.client.Element; import com.vaadin.terminal.gwt.client.AbstractFieldState; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.Paintable; import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; +import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; import com.vaadin.terminal.gwt.client.ui.Connect; import com.vaadin.terminal.gwt.client.ui.tree.VTree.TreeNode; @@ -27,6 +31,8 @@ public class TreeConnector extends AbstractComponentConnector implements public static final String ATTRIBUTE_ACTION_CAPTION = "caption"; public static final String ATTRIBUTE_ACTION_ICON = ATTRIBUTE_NODE_ICON; + protected final Map tooltipMap = new HashMap(); + public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; @@ -62,6 +68,8 @@ public class TreeConnector extends AbstractComponentConnector implements getWidget().body.clear(); // clear out any references to nodes that no longer are attached getWidget().clearNodeToKeyMap(); + tooltipMap.clear(); + TreeNode childTree = null; UIDL childUidl = null; for (final Iterator i = uidl.getChildIterator(); i.hasNext();) { @@ -74,6 +82,7 @@ public class TreeConnector extends AbstractComponentConnector implements continue; } childTree = getWidget().new TreeNode(); + getConnection().getVTooltip().connectHandlersToWidget(childTree); updateNodeFromUIDL(childTree, childUidl); getWidget().body.add(childTree); childTree.addStyleDependentName("root"); @@ -193,13 +202,8 @@ public class TreeConnector extends AbstractComponentConnector implements } String description = uidl.getStringAttribute("descr"); - if (description != null && getConnection() != null) { - // Set tooltip - TooltipInfo info = new TooltipInfo(description); - getConnection().registerTooltip(this, nodeKey, info); - } else { - // Remove possible previous tooltip - getConnection().registerTooltip(this, nodeKey, null); + if (description != null) { + tooltipMap.put(treeNode, new TooltipInfo(description)); } if (uidl.getBooleanAttribute("expanded") && !treeNode.getState()) { @@ -228,6 +232,7 @@ public class TreeConnector extends AbstractComponentConnector implements continue; } final TreeNode childTree = getWidget().new TreeNode(); + getConnection().getVTooltip().connectHandlersToWidget(childTree); updateNodeFromUIDL(childTree, childUidl); containerNode.childNodeContainer.add(childTree); if (!i.hasNext()) { @@ -250,4 +255,32 @@ public class TreeConnector extends AbstractComponentConnector implements return (AbstractFieldState) super.getState(); } + @Override + public TooltipInfo getTooltipInfo(Element element) { + + TooltipInfo info = null; + + // Try to find a tooltip for a node + if (element != getWidget().getElement()) { + Object node = Util.findWidget( + (com.google.gwt.user.client.Element) element, + TreeNode.class); + + if (node != null) { + TreeNode tnode = (TreeNode) node; + if (tnode.isCaptionElement(element)) { + info = tooltipMap.get(tnode); + } + } + } + + // If no tooltip found for the node or if the target was not a node, use + // the default tooltip + if (info == null) { + info = super.getTooltipInfo(element); + } + + return info; + } + } diff --git a/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java index 6f19cba957..7462160bad 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java @@ -45,7 +45,6 @@ import com.vaadin.terminal.gwt.client.MouseEventDetails; import com.vaadin.terminal.gwt.client.MouseEventDetailsBuilder; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.Action; import com.vaadin.terminal.gwt.client.ui.ActionOwner; import com.vaadin.terminal.gwt.client.ui.FocusElementPanel; @@ -656,12 +655,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, return; } - if (target == nodeCaptionSpan) { - client.handleTooltipEvent(event, VTree.this, key); - } - - final boolean inCaption = target == nodeCaptionSpan - || (icon != null && target == icon.getElement()); + final boolean inCaption = isCaptionElement(target); if (inCaption && client .hasEventListeners(VTree.this, ITEM_CLICK_EVENT_ID) @@ -751,6 +745,18 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } } + /** + * Checks if the given element is the caption or the icon. + * + * @param target + * The element to check + * @return true if the element is the caption or the icon + */ + public boolean isCaptionElement(com.google.gwt.dom.client.Element target) { + return (target == nodeCaptionSpan || (icon != null && target == icon + .getElement())); + } + private void fireClick(final Event evt) { /* * Ensure we have focus in tree before sending variables. Otherwise @@ -825,7 +831,6 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, + "-caption"); Element wrapper = DOM.createDiv(); nodeCaptionSpan = DOM.createSpan(); - DOM.sinkEvents(nodeCaptionSpan, VTooltip.TOOLTIP_EVENTS); DOM.appendChild(getElement(), nodeCaptionDiv); DOM.appendChild(nodeCaptionDiv, wrapper); DOM.appendChild(wrapper, nodeCaptionSpan); diff --git a/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java b/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java index 4fe53fb89c..ac475ce5a5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java +++ b/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java @@ -24,7 +24,6 @@ import com.google.gwt.user.client.ui.SimplePanel; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.VConsole; -import com.vaadin.terminal.gwt.client.VTooltip; import com.vaadin.terminal.gwt.client.ui.button.VButton; /** @@ -128,16 +127,6 @@ public class VUpload extends SimplePanel { panel.add(submitButton); setStyleName(CLASSNAME); - - sinkEvents(VTooltip.TOOLTIP_EVENTS); - } - - @Override - public void onBrowserEvent(Event event) { - if ((event.getTypeInt() & VTooltip.TOOLTIP_EVENTS) > 0) { - client.handleTooltipEvent(event, this); - } - super.onBrowserEvent(event); } private static native void setEncoding(Element form, String encoding) diff --git a/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java index 8fd84a9ea6..3946a026c6 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java @@ -552,11 +552,6 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, final Element target = DOM.eventGetTarget(event); - if (client != null && header.isOrHasChild(target)) { - // Handle window caption tooltips - client.handleTooltipEvent(event, this); - } - if (resizing || resizeBox == target) { onResizeEvent(event); bubble = false; diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java new file mode 100644 index 0000000000..17cc4270fb --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java @@ -0,0 +1,50 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.tests.components.abstractcomponent; + +import com.vaadin.terminal.WrappedRequest; +import com.vaadin.tests.VaadinClasses; +import com.vaadin.tests.components.AbstractTestRoot; +import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.Component; +import com.vaadin.ui.GridLayout; + +public class AllComponentTooltipTest extends AbstractTestRoot { + + @Override + protected void setup(WrappedRequest request) { + setContent(new GridLayout(5, 5)); + for (Class cls : VaadinClasses.getComponents()) { + try { + AbstractComponent c = (AbstractComponent) cls.newInstance(); + if (c instanceof LegacyWindow) { + continue; + } + + c.setDebugId(cls.getName()); + c.setCaption(cls.getName()); + c.setDescription(cls.getName()); + c.setWidth("100px"); + c.setHeight("100px"); + getContent().addComponent(c); + System.out.println("Added " + cls.getName()); + } catch (Exception e) { + System.err.println("Could not instatiate " + cls.getName()); + } + } + } + + @Override + protected String getTestDescription() { + // TODO Auto-generated method stub + return null; + } + + @Override + protected Integer getTicketNumber() { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html new file mode 100644 index 0000000000..a1d4fc9b35 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html @@ -0,0 +1,77 @@ + + + + + + +TooltipTests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TooltipTests
open/run/com.vaadin.tests.components.abstractcomponent.TooltipTests?restartApplication
showTooltip//div[@id='label']
screenCaptureno_tooltip
mouseClickvaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VCheckBox[0]/domChild[0]10,7
showTooltip//div[@id='label']
screenCapturepanel_tooltip
mouseClickvaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VCheckBox[1]/domChild[0]8,6
showTooltip//div[@id='label']
screenCapturelayout_tooltip
mouseClickvaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VCheckBox[2]/domChild[0]5,5
showTooltip//div[@id='label']
screenCapturelabel_tooltip
+ + diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java new file mode 100644 index 0000000000..c009e1d7bc --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java @@ -0,0 +1,97 @@ +package com.vaadin.tests.components.abstractcomponent; + +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; +import com.vaadin.ui.VerticalLayout; + +public class TooltipTests extends TestBase { + + private Panel panel; + private VerticalLayout layout; + private Label label; + + @Override + protected String getDescription() { + return "Generic tooltip handling tests"; + } + + @Override + protected Integer getTicketNumber() { + return 8425; + } + + @Override + protected void setup() { + HorizontalLayout topLayout = new HorizontalLayout(); + addComponent(topLayout); + CheckBox panelCbox = new CheckBox("Panel"); + panelCbox.addListener(panelListener); + topLayout.addComponent(panelCbox); + CheckBox layoutCbox = new CheckBox("Layout"); + layoutCbox.addListener(layoutListener); + topLayout.addComponent(layoutCbox); + CheckBox labelCbox = new CheckBox("Label"); + topLayout.addComponent(labelCbox); + labelCbox.addListener(labelListener); + + panel = new Panel(); + panel.setCaption("Panel caption"); + panel.setDebugId("panel"); + addComponent(panel); + + layout = new VerticalLayout(); + layout.setDebugId("layout"); + layout.setMargin(true); + layout.setSpacing(true); + panel.setContent(layout); + + label = new Label("Hover me!"); + label.setDebugId("label"); + layout.addComponent(label); + } + + private final Property.ValueChangeListener panelListener = new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + boolean value = (Boolean) (event.getProperty().getValue()); + if (value) { + panel.setDescription("I'm panel!"); + } else { + panel.setDescription(""); + } + } + + }; + + private final Property.ValueChangeListener layoutListener = new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + boolean value = (Boolean) (event.getProperty().getValue()); + if (value) { + layout.setDescription("I'm layout!"); + } else { + layout.setDescription(""); + } + } + + }; + + private final Property.ValueChangeListener labelListener = new Property.ValueChangeListener() { + + public void valueChange(ValueChangeEvent event) { + boolean value = (Boolean) (event.getProperty().getValue()); + if (value) { + label.setDescription("I'm label!"); + } else { + label.setDescription(""); + } + } + + }; + +} -- cgit v1.2.3 From e9b1233e49b66c97f5237538e8299ad75aa9c88b Mon Sep 17 00:00:00 2001 From: Pekka Hyvönen Date: Thu, 28 Jun 2012 16:42:33 +0300 Subject: Fixed connector so it no longer overwrites all style attributes (#8664) --- .../gwt/client/ui/AbstractComponentConnector.java | 156 +++++-- .../gwt/client/ui/AbstractFieldConnector.java | 21 +- .../ui/datefield/AbstractDateFieldConnector.java | 14 +- .../ui/datefield/PopupDateFieldConnector.java | 34 +- .../gwt/client/ui/embedded/EmbeddedConnector.java | 22 + .../terminal/gwt/client/ui/embedded/VEmbedded.java | 1 + .../components/AddRemoveSetStyleNamesTest.html | 456 +++++++++++++++++++++ .../components/AddRemoveSetStyleNamesTest.java | 81 ++++ 8 files changed, 714 insertions(+), 71 deletions(-) create mode 100644 tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html create mode 100644 tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java index 2f55cc4d16..6105c545f6 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java @@ -3,6 +3,8 @@ */ package com.vaadin.terminal.gwt.client.ui; +import java.util.ArrayList; +import java.util.List; import java.util.Set; import com.google.gwt.dom.client.Element; @@ -22,6 +24,7 @@ import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.VConsole; import com.vaadin.terminal.gwt.client.communication.StateChangeEvent; +import com.vaadin.terminal.gwt.client.ui.datefield.PopupDateFieldConnector; import com.vaadin.terminal.gwt.client.ui.root.RootConnector; public abstract class AbstractComponentConnector extends AbstractConnector @@ -32,6 +35,12 @@ public abstract class AbstractComponentConnector extends AbstractConnector private String lastKnownWidth = ""; private String lastKnownHeight = ""; + /** + * The style names from getState().getStyles() which are currently applied + * to the widget. + */ + protected List styleNames = new ArrayList(); + /** * Default constructor */ @@ -41,7 +50,11 @@ public abstract class AbstractComponentConnector extends AbstractConnector @Override protected void init() { super.init(); + getConnection().getVTooltip().connectHandlersToWidget(getWidget()); + + // Set v-connector style names for the widget + getWidget().setStyleName("v-connector", true); } /** @@ -103,8 +116,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector super.onStateChanged(stateChangeEvent); // Style names - String styleName = getStyleNames(getWidget().getStylePrimaryName()); - getWidget().setStyleName(styleName); + updateWidgetStyleNames(); // Set captions if (delegateCaptionHandling()) { @@ -127,12 +139,14 @@ public abstract class AbstractComponentConnector extends AbstractConnector } public void setWidgetEnabled(boolean widgetEnabled) { + // add or remove v-disabled style name from the widget + setWidgetStyleName(ApplicationConnection.DISABLED_CLASSNAME, + !widgetEnabled); + if (getWidget() instanceof HasEnabled) { // set widget specific enabled state ((HasEnabled) getWidget()).setEnabled(widgetEnabled); - // add or remove v-disabled style name from the widget - getWidget().setStyleName(ApplicationConnection.DISABLED_CLASSNAME, - !widgetEnabled); + // make sure the caption has or has not v-disabled style if (delegateCaptionHandling()) { ServerConnector parent = getParent(); @@ -210,58 +224,112 @@ public abstract class AbstractComponentConnector extends AbstractConnector } /** - * Generates the style name for the widget based on the given primary style - * name and the shared state. + * Updates the user defined, read-only and error style names for the widget + * based the shared state. User defined style names are prefixed with the + * primary style name of the widget returned by {@link #getWidget()} *

* This method can be overridden to provide additional style names for the - * component + * component, for example see + * {@link AbstractFieldConnector#updateWidgetStyleNames()} *

- * - * @param primaryStyleName - * The primary style name to use when generating the final style - * names - * @return The style names, settable using - * {@link Widget#setStyleName(String)} */ - protected String getStyleNames(String primaryStyleName) { + protected void updateWidgetStyleNames() { ComponentState state = getState(); - StringBuilder styleBuf = new StringBuilder(); - styleBuf.append(primaryStyleName); - styleBuf.append(" v-connector"); + String primaryStyleName = getWidget().getStylePrimaryName(); - // Uses connector methods to enable connectors to take hierarchy or - // multiple state variables into account - if (!isEnabled()) { - styleBuf.append(" "); - styleBuf.append(ApplicationConnection.DISABLED_CLASSNAME); - } - if (isReadOnly()) { - styleBuf.append(" "); - styleBuf.append("v-readonly"); - } + // should be in AbstractFieldConnector ? + // add / remove read-only style name + setWidgetStyleName("v-readonly", isReadOnly()); + + // add / remove error style name + setWidgetStyleNameWithPrefix(primaryStyleName, + ApplicationConnection.ERROR_CLASSNAME_EXT, + null != state.getErrorMessage()); - // add additional styles as css classes, prefixed with component default - // stylename + // add additional user defined style names as class names, prefixed with + // component default class name. remove nonexistent style names. if (state.hasStyles()) { - for (String style : state.getStyles()) { - styleBuf.append(" "); - styleBuf.append(primaryStyleName); - styleBuf.append("-"); - styleBuf.append(style); - styleBuf.append(" "); - styleBuf.append(style); + // add new style names + List newStyles = new ArrayList(); + newStyles.addAll(state.getStyles()); + newStyles.removeAll(styleNames); + for (String newStyle : newStyles) { + setWidgetStyleName(newStyle, true); + setWidgetStyleNameWithPrefix(primaryStyleName + "-", newStyle, + true); + } + // remove nonexistent style names + styleNames.removeAll(state.getStyles()); + for (String oldStyle : styleNames) { + setWidgetStyleName(oldStyle, false); + setWidgetStyleNameWithPrefix(primaryStyleName + "-", oldStyle, + false); + } + styleNames.clear(); + styleNames.addAll(state.getStyles()); + } else { + // remove all old style names + for (String oldStyle : styleNames) { + setWidgetStyleName(oldStyle, false); + setWidgetStyleNameWithPrefix(primaryStyleName + "-", oldStyle, + false); } + styleNames.clear(); } - // add error classname to components w/ error - if (null != state.getErrorMessage()) { - styleBuf.append(" "); - styleBuf.append(primaryStyleName); - styleBuf.append(ApplicationConnection.ERROR_CLASSNAME_EXT); - } + } - return styleBuf.toString(); + /** + * This is used to add / remove state related style names from the widget. + *

+ * Override this method for example if the style name given here should be + * updated in another widget in addition to the one returned by the + * {@link #getWidget()}. + *

+ * + * @param styleName + * the style name to be added or removed + * @param add + * true to add the given style, false + * to remove it + */ + protected void setWidgetStyleName(String styleName, boolean add) { + getWidget().setStyleName(styleName, add); + } + + /** + * This is used to add / remove state related prefixed style names from the + * widget. + *

+ * Override this method if the prefixed style name given here should be + * updated in another widget in addition to the one returned by the + * Connector's {@link #getWidget()}, or if the prefix should be + * different. For example see + * {@link PopupDateFieldConnector#setWidgetStyleNameWithPrefix(String, String, boolean)} + *

+ * + * @param styleName + * the style name to be added or removed + * @param add + * true to add the given style, false + * to remove it + * @deprecated This will be removed once styles are no longer added with + * prefixes. + */ + @Deprecated + protected void setWidgetStyleNameWithPrefix(String prefix, + String styleName, boolean add) { + if (!styleName.startsWith("-")) { + if (!prefix.endsWith("-")) { + prefix += "-"; + } + } else { + if (prefix.endsWith("-")) { + styleName.replaceFirst("-", ""); + } + } + getWidget().setStyleName(prefix + styleName, add); } /* diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java index 4be0f02c2a..5bff88c774 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractFieldConnector.java @@ -35,20 +35,15 @@ public abstract class AbstractFieldConnector extends AbstractComponentConnector } @Override - protected String getStyleNames(String primaryStyleName) { - String styleNames = super.getStyleNames(primaryStyleName); + protected void updateWidgetStyleNames() { + super.updateWidgetStyleNames(); - if (isModified()) { - // add modified classname to Fields - styleNames += " " + ApplicationConnection.MODIFIED_CLASSNAME; - } + // add / remove modified style name to Fields + setWidgetStyleName(ApplicationConnection.MODIFIED_CLASSNAME, + isModified()); - if (isRequired()) { - // add required classname to Fields - styleNames += " " + primaryStyleName - + ApplicationConnection.REQUIRED_CLASSNAME_EXT; - } - - return styleNames; + // add / remove error style name to Fields + setWidgetStyleNameWithPrefix(getWidget().getStylePrimaryName(), + ApplicationConnection.REQUIRED_CLASSNAME_EXT, isRequired()); } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java index b55f480bac..72555214fa 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java @@ -63,15 +63,17 @@ public class AbstractDateFieldConnector extends AbstractFieldConnector newResolution = VDateField.RESOLUTION_YEAR; } + // Remove old stylename that indicates current resolution + setWidgetStyleNameWithPrefix(VDateField.CLASSNAME, + VDateField.resolutionToString(getWidget().currentResolution), + false); + getWidget().currentResolution = newResolution; // Add stylename that indicates current resolution - getWidget() - .addStyleName( - VDateField.CLASSNAME - + "-" - + VDateField - .resolutionToString(getWidget().currentResolution)); + setWidgetStyleNameWithPrefix(VDateField.CLASSNAME, + VDateField.resolutionToString(getWidget().currentResolution), + true); final int year = uidl.getIntVariable("year"); final int month = (getWidget().currentResolution >= VDateField.RESOLUTION_MONTH) ? uidl diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java index e169d83b48..dfe0b327ac 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java @@ -35,14 +35,6 @@ public class PopupDateFieldConnector extends TextualDateConnector { super.updateFromUIDL(uidl, client); - String popupStyleNames = getStyleNames(VPopupCalendar.POPUP_PRIMARY_STYLE_NAME); - popupStyleNames += " " - + VDateField.CLASSNAME - + "-" - + VPopupCalendar - .resolutionToString(getWidget().currentResolution); - getWidget().popup.setStyleName(popupStyleNames); - getWidget().calendar.setDateTimeService(getWidget() .getDateTimeService()); getWidget().calendar.setShowISOWeekNumbers(getWidget() @@ -114,4 +106,30 @@ public class PopupDateFieldConnector extends TextualDateConnector { public VPopupCalendar getWidget() { return (VPopupCalendar) super.getWidget(); } + + @Override + protected void setWidgetStyleName(String styleName, boolean add) { + super.setWidgetStyleName(styleName, add); + + // update the style change to popup calendar widget + getWidget().popup.setStyleName(styleName, add); + } + + @Override + protected void setWidgetStyleNameWithPrefix(String prefix, + String styleName, boolean add) { + super.setWidgetStyleNameWithPrefix(prefix, styleName, add); + + // update the style change to popup calendar widget with the correct + // prefix + if (!styleName.startsWith("-")) { + getWidget().popup.setStyleName( + VPopupCalendar.POPUP_PRIMARY_STYLE_NAME + "-" + styleName, + add); + } else { + getWidget().popup.setStyleName( + VPopupCalendar.POPUP_PRIMARY_STYLE_NAME + styleName, add); + } + } + } diff --git a/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java b/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java index af3ad67db4..fe3549e7f2 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java @@ -54,6 +54,16 @@ public class EmbeddedConnector extends AbstractComponentConnector implements clickEventHandler.handleEventHandlerRegistration(); if (uidl.hasAttribute("type")) { + // remove old style name related to type + if (getWidget().type != null) { + getWidget().removeStyleName( + VEmbedded.CLASSNAME + "-" + getWidget().type); + } + // remove old style name related to mime type + if (getWidget().mimetype != null) { + getWidget().removeStyleName( + VEmbedded.CLASSNAME + "-" + getWidget().mimetype); + } getWidget().type = uidl.getStringAttribute("type"); if (getWidget().type.equals("image")) { getWidget().addStyleName(VEmbedded.CLASSNAME + "-image"); @@ -118,13 +128,25 @@ public class EmbeddedConnector extends AbstractComponentConnector implements VConsole.log("Unknown Embedded type '" + getWidget().type + "'"); } } else if (uidl.hasAttribute("mimetype")) { + // remove old style name related to type + if (getWidget().type != null) { + getWidget().removeStyleName( + VEmbedded.CLASSNAME + "-" + getWidget().type); + } + // remove old style name related to mime type + if (getWidget().mimetype != null) { + getWidget().removeStyleName( + VEmbedded.CLASSNAME + "-" + getWidget().mimetype); + } final String mime = uidl.getStringAttribute("mimetype"); if (mime.equals("application/x-shockwave-flash")) { + getWidget().mimetype = "flash"; // Handle embedding of Flash getWidget().addStyleName(VEmbedded.CLASSNAME + "-flash"); getWidget().setHTML(getWidget().createFlashEmbed(uidl)); } else if (mime.equals("image/svg+xml")) { + getWidget().mimetype = "svg"; getWidget().addStyleName(VEmbedded.CLASSNAME + "-svg"); String data; Map parameters = VEmbedded.getParameters(uidl); diff --git a/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java b/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java index 5edd31174d..1d2a5a156a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java +++ b/src/com/vaadin/terminal/gwt/client/ui/embedded/VEmbedded.java @@ -26,6 +26,7 @@ public class VEmbedded extends HTML { protected Element browserElement; protected String type; + protected String mimetype; protected ApplicationConnection client; diff --git a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html new file mode 100644 index 0000000000..a09a1e06e5 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html @@ -0,0 +1,456 @@ + + + + + + +AddRemoveSetStyleNamesTest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AddRemoveSetStyleNamesTest
openrun/com.vaadin.tests.components.AddRemoveSetStyleNamesTest?restartApplication
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
+ + diff --git a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java new file mode 100644 index 0000000000..21cf9e45a6 --- /dev/null +++ b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java @@ -0,0 +1,81 @@ +package com.vaadin.tests.components; + +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.PopupDateField; + +public class AddRemoveSetStyleNamesTest extends TestBase { + + private String style1 = "style1"; + private String style2 = "style2"; + private String thestyle = "thestyle"; + + private PopupDateField popupDateField; + private Button button1; + private Button button2; + private Button button3; + + private Button.ClickListener listener; + + @Override + protected void setup() { + popupDateField = new PopupDateField("PopupDateField"); + popupDateField.setRequired(true); + popupDateField.setRequiredError("abcd"); + addComponent(popupDateField); + + listener = new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + String style = (String) event.getButton().getData(); + setComponentsStyle(style, !popupDateField.getStyleName() + .contains(style), event.getButton()); + } + }; + + button1 = new Button("Add style1", listener); + button1.setData(style1); + addComponent(button1); + + button2 = new Button("Add style2", listener); + button2.setData(style2); + addComponent(button2); + + button3 = new Button("Set thestyle", new Button.ClickListener() { + + public void buttonClick(ClickEvent event) { + if (popupDateField.getStyleName().contains(thestyle)) { + popupDateField.removeStyleName(thestyle); + button3.setCaption("Set thestyle"); + } else { + popupDateField.setStyleName(thestyle); + button1.setCaption("Add style1"); + button2.setCaption("Add style2"); + button3.setCaption("Remove thestyle"); + } + } + }); + addComponent(button3); + } + + private void setComponentsStyle(String style, boolean add, Button button) { + if (add) { + popupDateField.addStyleName(style); + button.setCaption("Remove " + style); + } else { + popupDateField.removeStyleName(style); + button.setCaption("Add " + style); + } + } + + @Override + protected String getDescription() { + return "If a widget has set multiple css class names, AbtractComponentConnector.getStyleNames() removes all but first one of them. This is not acceptable, because we should be able to create connector for any existing GWT component and thus we do not know it it depends on multiple css class names."; + } + + @Override + protected Integer getTicketNumber() { + return 8664; + } + +} \ No newline at end of file -- cgit v1.2.3 From 2d9849ebfe70fff9bcb832e373baada14b0d387d Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 28 Jun 2012 18:46:16 +0300 Subject: Update #9048 based on reviews --- .../terminal/gwt/client/ApplicationConnection.java | 13 +++- .../gwt/server/AbstractApplicationServlet.java | 9 +-- .../gwt/server/AbstractCommunicationManager.java | 75 ++++++++++++++-------- 3 files changed, 65 insertions(+), 32 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index da4dfa08dc..1308e7aac7 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -76,6 +76,10 @@ import com.vaadin.terminal.gwt.server.AbstractCommunicationManager; * Entry point classes (widgetsets) define onModuleLoad(). */ public class ApplicationConnection { + private static final String CONNECTOR_PROTOCOL_PREFIX = "connector://"; + + public static final String CONNECTOR_RESOURCE_PREFIX = "APP/CONNECTOR"; + // This indicates the whole page is generated by us (not embedded) public static final String GENERATED_BODY_CLASSNAME = "v-generated-body"; @@ -2285,9 +2289,12 @@ public class ApplicationConnection { } if (uidlUri.startsWith("app://")) { uidlUri = getAppUri() + uidlUri.substring(6); - } else if (uidlUri.startsWith("connector://")) { - uidlUri = getAppUri() + "APP/CONNECTOR/" - + uidlUri.substring("connector://".length()); + } else if (uidlUri.startsWith(CONNECTOR_PROTOCOL_PREFIX)) { + // getAppUri *should* always end with / + // substring *should* always start with / (connector:///foo.bar + // without connector://) + uidlUri = getAppUri() + CONNECTOR_RESOURCE_PREFIX + + uidlUri.substring(CONNECTOR_PROTOCOL_PREFIX.length()); } return uidlUri; } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 6930961497..7d88b432f4 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -136,8 +136,6 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements static final String UPLOAD_URL_PREFIX = "APP/UPLOAD/"; - static final String CONNECTOR_RESOURCE_PREFIX = "/APP/CONNECTOR/"; - /** * Called by the servlet container to indicate to a servlet that the servlet * is being placed into service. @@ -400,8 +398,10 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements if (requestType == RequestType.CONNECTOR_RESOURCE) { String pathInfo = getRequestPathInfo(request); + // + 2 to also remove beginning and ending slashes String resourceName = pathInfo - .substring(CONNECTOR_RESOURCE_PREFIX.length()); + .substring(ApplicationConnection.CONNECTOR_RESOURCE_PREFIX + .length() + 2); final String mimetype = getServletContext().getMimeType( resourceName); @@ -1295,7 +1295,8 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements private boolean isConnectorResourceRequest(HttpServletRequest request) { String path = getRequestPathInfo(request); - if (path != null && path.startsWith(CONNECTOR_RESOURCE_PREFIX)) { + if (path != null + && path.startsWith('/' + ApplicationConnection.CONNECTOR_RESOURCE_PREFIX + '/')) { return true; } return false; diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 4ee300edac..8c4377ac64 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -160,7 +160,7 @@ public abstract class AbstractCommunicationManager implements Serializable { private Connector highlightedConnector; - private Map> connectoResourceContexts = new HashMap>(); + private Map> connectorResourceContexts = new HashMap>(); /** * TODO New constructor - document me! @@ -1217,49 +1217,50 @@ public abstract class AbstractCommunicationManager implements Serializable { writePerformanceData(outWriter); } - private String registerResource(String resource, Class context) { + /** + * Resolves a resource URI, registering the URI with this + * {@code AbstractCommunicationManager} if needed and returns a fully + * qualified URI. + */ + private String registerResource(String resourceUri, Class context) { try { - URI uri = new URI(resource); + URI uri = new URI(resourceUri); String protocol = uri.getScheme(); if ("connector".equals(protocol)) { - return registerContextResource(uri, context); + // Strip initial slash + String resourceName = uri.getPath().substring(1); + return registerConnecctorResource(resourceName, context); } if (protocol != null || uri.getHost() != null) { - return resource; - } - - String path = uri.getPath(); - if (path.startsWith("/")) { - return resource; + return resourceUri; } - // Default if just simple relative url - return registerContextResource(uri, context); + // Bare path interpreted as connector resource + return registerConnecctorResource(resourceUri, context); } catch (URISyntaxException e) { getLogger().log(Level.WARNING, - "Could not parse resource url " + resource, e); - return resource; + "Could not parse resource url " + resourceUri, e); + return resourceUri; } } - private String registerContextResource(URI uri, Class context) { - String path = uri.getPath(); - synchronized (connectoResourceContexts) { - // Connector resource - if (connectoResourceContexts.containsKey(path)) { - Class oldContext = connectoResourceContexts.get(path); + private String registerConnecctorResource(String name, Class context) { + synchronized (connectorResourceContexts) { + // Add to map of names accepted by serveConnectorResource + if (connectorResourceContexts.containsKey(name)) { + Class oldContext = connectorResourceContexts.get(name); getLogger().warning( - "Resource " + path + " defined by both " + context + "Resource " + name + " defined by both " + context + " and " + oldContext + ". Resource from " + oldContext + " will be used."); } else { - connectoResourceContexts.put(path, context); + connectorResourceContexts.put(name, context); } } - return "connector://" + path; + return "connector:///" + name; } /** @@ -2385,29 +2386,53 @@ public abstract class AbstractCommunicationManager implements Serializable { return initialUIDL; } + /** + * Serve a connector resource from the classpath if the resource has + * previously been registered by calling + * {@link #registerResource(String, Class)}. Sending arbitrary files from + * the classpath is prevented by only accepting resource names that have + * explicitly been registered. Resources can currently only be registered by + * including a {@link JavaScript} or {@link StyleSheet} annotation on a + * Connector class. + * + * @param resourceName + * @param request + * @param response + * @param mimetype + * @throws IOException + */ public void serveConnectorResource(String resourceName, WrappedRequest request, WrappedResponse response, String mimetype) throws IOException { + // Security check: avoid accidentally serving from the root of the + // classpath instead of relative to the context class if (resourceName.startsWith("/")) { response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); return; } + // Check that the resource name has been registered Class context; - synchronized (connectoResourceContexts) { - context = connectoResourceContexts.get(resourceName); + synchronized (connectorResourceContexts) { + context = connectorResourceContexts.get(resourceName); } + // Security check: don't serve resource if the name hasn't been + // registered in the map if (context == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); return; } + // Resolve file relative to the location of the context class InputStream in = context.getResourceAsStream(resourceName); if (in == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); return; } + + // TODO Check and set cache headers + OutputStream out = null; try { if (mimetype != null) { -- cgit v1.2.3 From 0026faa5f5796c68fd4e96afdbd8574dc54a515d Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 28 Jun 2012 19:00:08 +0300 Subject: Add logging for rejected connector resource requests (#9048) --- .../terminal/gwt/server/AbstractCommunicationManager.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 8c4377ac64..ba17822813 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -2407,6 +2407,9 @@ public abstract class AbstractCommunicationManager implements Serializable { // Security check: avoid accidentally serving from the root of the // classpath instead of relative to the context class if (resourceName.startsWith("/")) { + getLogger().warning( + "Connector resource request starting with / rejected: " + + resourceName); response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); return; } @@ -2420,6 +2423,9 @@ public abstract class AbstractCommunicationManager implements Serializable { // Security check: don't serve resource if the name hasn't been // registered in the map if (context == null) { + getLogger().warning( + "Connector resource request for unkown resource rejected: " + + resourceName); response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); return; } @@ -2427,6 +2433,12 @@ public abstract class AbstractCommunicationManager implements Serializable { // Resolve file relative to the location of the context class InputStream in = context.getResourceAsStream(resourceName); if (in == null) { + getLogger().warning( + resourceName + " defined by " + context.getName() + + " not found. Verify that the file " + + context.getPackage().getName().replace('.', '/') + + '/' + resourceName + + " is available on the classpath."); response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); return; } -- cgit v1.2.3 From b9b9c2dcd65181e7a0a8bbcad80b51cdce0937d2 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 28 Jun 2012 19:45:35 +0300 Subject: Rename getWidgetElement() -> getElement() (#8888) --- WebContent/statictestfiles/jsconnector.js | 2 +- src/com/vaadin/terminal/AbstractJavaScriptExtension.java | 6 +++--- src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java | 2 +- src/com/vaadin/ui/AbstractJavaScriptComponent.java | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/WebContent/statictestfiles/jsconnector.js b/WebContent/statictestfiles/jsconnector.js index d7f697dbf5..a87df92bc8 100644 --- a/WebContent/statictestfiles/jsconnector.js +++ b/WebContent/statictestfiles/jsconnector.js @@ -1,7 +1,7 @@ window.com_vaadin_tests_components_javascriptcomponent_BasicJavaScriptComponent_ExampleWidget = function() { var connector = this; - var rootElement = connector.getWidgetElement(); + var rootElement = connector.getElement(); rootElement.innerHTML = 'Hello world!'; rootElement.onclick = function() { connector.getRpcProxy().onClick("message"); diff --git a/src/com/vaadin/terminal/AbstractJavaScriptExtension.java b/src/com/vaadin/terminal/AbstractJavaScriptExtension.java index bdcd948c74..77540c355a 100644 --- a/src/com/vaadin/terminal/AbstractJavaScriptExtension.java +++ b/src/com/vaadin/terminal/AbstractJavaScriptExtension.java @@ -34,9 +34,9 @@ import com.vaadin.ui.JavaScriptCallback; * the connector's parent. If connectorId is provided, the id of * the parent of the corresponding connector with the passed id is returned * instead. - *
  • getWidgetElement([connectorId]) - returns the DOM Element - * that is the root of a connector's widget. null is returned if - * the connector can not be found or if the connector doesn't have a widget. If + *
  • getElement([connectorId]) - returns the DOM Element that is + * the root of a connector's widget. null is returned if the + * connector can not be found or if the connector doesn't have a widget. If * connectorId is not provided, the connector id of the current * connector will be used.
  • *
  • getState() - returns an object corresponding to the shared diff --git a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java index f3a3aa3e83..86c11fd26d 100644 --- a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java +++ b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java @@ -185,7 +185,7 @@ public class JavaScriptConnectorHelper { } return rpcObjects.@java.util.Map::get(Ljava/lang/Object;)(iface); }), - 'getWidgetElement': $entry(function(connectorId) { + 'getElement': $entry(function(connectorId) { return h.@com.vaadin.terminal.gwt.client.JavaScriptConnectorHelper::getWidgetElement(Ljava/lang/String;)(connectorId); }), 'registerRpc': function(iface, rpcHandler) { diff --git a/src/com/vaadin/ui/AbstractJavaScriptComponent.java b/src/com/vaadin/ui/AbstractJavaScriptComponent.java index 0d7f60186a..969c5b7fcd 100644 --- a/src/com/vaadin/ui/AbstractJavaScriptComponent.java +++ b/src/com/vaadin/ui/AbstractJavaScriptComponent.java @@ -37,9 +37,9 @@ import com.vaadin.terminal.gwt.client.ui.JavaScriptWidget; * the connector's parent. If connectorId is provided, the id of * the parent of the corresponding connector with the passed id is returned * instead.
  • - *
  • getWidgetElement([connectorId]) - returns the DOM Element - * that is the root of a connector's widget. null is returned if - * the connector can not be found or if the connector doesn't have a widget. If + *
  • getElement([connectorId]) - returns the DOM Element that is + * the root of a connector's widget. null is returned if the + * connector can not be found or if the connector doesn't have a widget. If * connectorId is not provided, the connector id of the current * connector will be used.
  • *
  • getState() - returns an object corresponding to the shared -- cgit v1.2.3 From 4402fd86495e703c00e949ca49d9799085432d46 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 Jun 2012 20:20:00 +0300 Subject: Support for SuperDevMode through ?superdevmode (#8983) --- .../gwt/client/ApplicationConfiguration.java | 5 + .../vaadin/terminal/gwt/client/SuperDevMode.java | 247 +++++++++++++++++++++ .../vaadin/terminal/gwt/client/VDebugConsole.java | 83 ++++--- 3 files changed, 307 insertions(+), 28 deletions(-) create mode 100644 src/com/vaadin/terminal/gwt/client/SuperDevMode.java (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 540841a6ae..31775d1d02 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -581,6 +581,11 @@ public class ApplicationConfiguration implements EntryPoint { } }); + if (SuperDevMode.enableBasedOnParameter()) { + // Do not start any application as super dev mode will refresh the + // page once done compiling + return; + } registerCallback(GWT.getModuleName()); deferredWidgetLoader = new DeferredWidgetLoader(); } diff --git a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java new file mode 100644 index 0000000000..77a82c9aaf --- /dev/null +++ b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java @@ -0,0 +1,247 @@ +package com.vaadin.terminal.gwt.client; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.http.client.UrlBuilder; +import com.google.gwt.jsonp.client.JsonpRequestBuilder; +import com.google.gwt.storage.client.Storage; +import com.google.gwt.user.client.Window.Location; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.vaadin.terminal.gwt.client.ui.notification.VNotification; +import com.vaadin.terminal.gwt.client.ui.notification.VNotification.EventListener; +import com.vaadin.terminal.gwt.client.ui.notification.VNotification.HideEvent; + +/** + * Class that enables SuperDevMode using a ?superdevmode parameter in the url. + * + * @author Vaadin Ltd + * @version @VERSION@ + * @since 7.0 + * + */ +public class SuperDevMode { + + private static final int COMPILE_TIMEOUT_IN_SECONDS = 60; + protected static final String SKIP_RECOMPILE = "VaadinSuperDevMode_skip_recompile"; + + public static class RecompileResult extends JavaScriptObject { + protected RecompileResult() { + + } + + public final native boolean ok() + /*-{ + return this.status == "ok"; + }-*/; + } + + private static void recompileWidgetsetAndStartInDevMode( + final String serverUrl) { + VConsole.log("Recompiling widgetset using
    " + serverUrl + + "
    and then reloading in super dev mode"); + VNotification n = new VNotification(); + n.show("Recompiling widgetset, this should not take too long", + VNotification.CENTERED, VNotification.STYLE_SYSTEM); + + JsonpRequestBuilder b = new JsonpRequestBuilder(); + b.setCallbackParam("_callback"); + b.setTimeout(COMPILE_TIMEOUT_IN_SECONDS * 1000); + b.requestObject(serverUrl + "recompile/" + GWT.getModuleName() + "?" + + getRecompileParameters(GWT.getModuleName()), + new AsyncCallback() { + + public void onSuccess(RecompileResult result) { + VConsole.log("JSONP compile call successful"); + + if (!result.ok()) { + VConsole.log("* result: " + result); + failed(); + return; + } + + setSession( + getSuperDevModeHookKey(), + getSuperDevWidgetSetUrl(GWT.getModuleName(), + serverUrl)); + setSession(SKIP_RECOMPILE, "1"); + + VConsole.log("* result: OK. Reloading"); + Location.reload(); + } + + public void onFailure(Throwable caught) { + VConsole.error("JSONP compile call failed"); + // Don't log exception as they are shown as + // notifications + VConsole.error(Util.getSimpleName(caught) + ": " + + caught.getMessage()); + failed(); + + } + + private void failed() { + VNotification n = new VNotification(); + n.addEventListener(new EventListener() { + + public void notificationHidden(HideEvent event) { + recompileWidgetsetAndStartInDevMode(serverUrl); + } + }); + n.show("Recompilation failed.
    " + + "Make sure CodeServer is running, " + + "check its output and click to retry", + VNotification.CENTERED, + VNotification.STYLE_SYSTEM); + } + }); + + } + + protected static String getSuperDevWidgetSetUrl(String widgetsetName, + String serverUrl) { + return serverUrl + GWT.getModuleName() + "/" + GWT.getModuleName() + + ".nocache.js"; + } + + private native static String getRecompileParameters(String moduleName) + /*-{ + var prop_map = $wnd.__gwt_activeModules[moduleName].bindings(); + + // convert map to URL parameter string + var props = []; + for (var key in prop_map) { + props.push(encodeURIComponent(key) + '=' + encodeURIComponent(prop_map[key])) + } + + return props.join('&') + '&'; + }-*/; + + private static void setSession(String key, String value) { + Storage.getSessionStorageIfSupported().setItem(key, value); + } + + private static String getSession(String key) { + return Storage.getSessionStorageIfSupported().getItem(key); + } + + private static void removeSession(String key) { + Storage.getSessionStorageIfSupported().removeItem(key); + } + + protected static void disableDevModeAndReload() { + removeSession(getSuperDevModeHookKey()); + redirect(false); + } + + protected static void redirect(boolean devModeOn) { + UrlBuilder createUrlBuilder = Location.createUrlBuilder(); + if (!devModeOn) { + createUrlBuilder.removeParameter("superdevmode"); + } else { + createUrlBuilder.setParameter("superdevmode", ""); + } + + Location.assign(createUrlBuilder.buildString()); + + } + + private static String getSuperDevModeHookKey() { + String widgetsetName = GWT.getModuleName(); + final String superDevModeKey = "__gwtDevModeHook:" + widgetsetName; + return superDevModeKey; + } + + private static boolean hasSession(String key) { + return getSession(key) != null; + } + + /** + * The URL of the code server. The default URL (http://localhost:9876/) will + * be used if this is empty or null. + * + * @param serverUrl + * The url of the code server or null to use the default + * @return true if recompile started, false if we are running in + * SuperDevMode + */ + protected static boolean recompileIfNeeded(String serverUrl) { + if (serverUrl == null || "".equals(serverUrl)) { + serverUrl = "http://localhost:9876/"; + } else { + serverUrl = "http://" + serverUrl + "/"; + } + + if (hasSession(SKIP_RECOMPILE)) { + VConsole.log("Running in SuperDevMode"); + // When we get here, we are running in super dev mode + + // Remove the flag so next reload will recompile + removeSession(SKIP_RECOMPILE); + + // Remove the gwt flag so we will not end up in dev mode if we + // remove the url parameter manually + removeSession(getSuperDevModeHookKey()); + + return false; + } + + recompileWidgetsetAndStartInDevMode(serverUrl); + return true; + } + + protected static boolean isSuperDevModeEnabledInModule() { + String moduleName = GWT.getModuleName(); + return isSuperDevModeEnabledInModule(moduleName); + } + + protected native static boolean isSuperDevModeEnabledInModule( + String moduleName) + /*-{ + if (!$wnd.__gwt_activeModules) + return false; + var mod = $wnd.__gwt_activeModules[moduleName]; + if (!mod) + return false; + + if (mod.superdevmode) { + // Running in super dev mode already, it is supported + return true; + } + + return mod.canRedirect; + }-*/; + + /** + * Enables SuperDevMode if the url contains the "superdevmode" parameter. + *

    + * The caller should not continue initialization of the application if this + * method returns true. The application will be restarted once compilation + * is done and then this method will return false. + *

    + * + * @return true if a recompile operation has started and the page will be + * reloaded once it is done, false if no recompilation will be done. + */ + public static boolean enableBasedOnParameter() { + String superDevModeParameter = Location.getParameter("superdevmode"); + if (superDevModeParameter != null) { + // Need to check the recompile flag also because if we are running + // in super dev mode, as a result of the recompile, the enabled + // check will fail... + if (!isSuperDevModeEnabledInModule()) { + showError("SuperDevMode is not enabled for this module/widgetset.
    " + + "Ensure that your module definition (.gwt.xml) contains
    " + + "<add-linker name="xsiframe"/>
    " + + "<set-configuration-property name="devModeRedirectEnabled" value="true" />
    "); + return false; + } + return SuperDevMode.recompileIfNeeded(superDevModeParameter); + } + return false; + } + + private static void showError(String message) { + VNotification n = new VNotification(); + n.show(message, VNotification.CENTERED_TOP, VNotification.STYLE_SYSTEM); + } +} diff --git a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java index 09e939336e..ce893741d3 100644 --- a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java +++ b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java @@ -24,6 +24,8 @@ import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.MouseOutEvent; import com.google.gwt.event.dom.client.MouseOutHandler; +import com.google.gwt.event.logical.shared.ValueChangeEvent; +import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.event.shared.UmbrellaException; import com.google.gwt.http.client.Request; @@ -33,6 +35,7 @@ import com.google.gwt.http.client.RequestException; import com.google.gwt.http.client.Response; import com.google.gwt.http.client.UrlBuilder; import com.google.gwt.i18n.client.DateTimeFormat; +import com.google.gwt.storage.client.Storage; import com.google.gwt.user.client.Cookies; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; @@ -160,7 +163,8 @@ public class VDebugConsole extends VOverlay implements Console { private Button savePosition = new Button("S"); private Button highlight = new Button("H"); private Button connectorStats = new Button("CS"); - private CheckBox hostedMode = new CheckBox("GWT"); + private CheckBox devMode = new CheckBox("Dev"); + private CheckBox superDevMode = new CheckBox("SDev"); private CheckBox autoScroll = new CheckBox("Autoscroll "); private HorizontalPanel actions; private boolean collapsed = false; @@ -717,33 +721,8 @@ public class VDebugConsole extends VOverlay implements Console { savePosition .setTitle("Saves the position and size of debug console to a cookie"); actions.add(autoScroll); - actions.add(hostedMode); - if (Location.getParameter("gwt.codesvr") != null) { - hostedMode.setValue(true); - } - hostedMode.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - if (hostedMode.getValue()) { - addHMParameter(); - } else { - removeHMParameter(); - } - } - - private void addHMParameter() { - UrlBuilder createUrlBuilder = Location.createUrlBuilder(); - createUrlBuilder.setParameter("gwt.codesvr", - "localhost:9997"); - Location.assign(createUrlBuilder.buildString()); - } - - private void removeHMParameter() { - UrlBuilder createUrlBuilder = Location.createUrlBuilder(); - createUrlBuilder.removeParameter("gwt.codesvr"); - Location.assign(createUrlBuilder.buildString()); - - } - }); + addDevMode(); + addSuperDevMode(); autoScroll .setTitle("Automatically scroll so that new messages are visible"); @@ -861,6 +840,54 @@ public class VDebugConsole extends VOverlay implements Console { } + private void addSuperDevMode() { + final Storage sessionStorage = Storage.getSessionStorageIfSupported(); + if (sessionStorage == null) { + return; + } + actions.add(superDevMode); + if (Location.getParameter("superdevmode") != null) { + superDevMode.setValue(true); + } + superDevMode.addValueChangeHandler(new ValueChangeHandler() { + + public void onValueChange(ValueChangeEvent event) { + SuperDevMode.redirect(event.getValue()); + } + + }); + + } + + private void addDevMode() { + actions.add(devMode); + if (Location.getParameter("gwt.codesvr") != null) { + devMode.setValue(true); + } + devMode.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent event) { + if (devMode.getValue()) { + addHMParameter(); + } else { + removeHMParameter(); + } + } + + private void addHMParameter() { + UrlBuilder createUrlBuilder = Location.createUrlBuilder(); + createUrlBuilder.setParameter("gwt.codesvr", "localhost:9997"); + Location.assign(createUrlBuilder.buildString()); + } + + private void removeHMParameter() { + UrlBuilder createUrlBuilder = Location.createUrlBuilder(); + createUrlBuilder.removeParameter("gwt.codesvr"); + Location.assign(createUrlBuilder.buildString()); + + } + }); + } + protected void dumpConnectorInfo(ApplicationConnection a) { RootConnector root = a.getRootConnector(); log("================"); -- cgit v1.2.3 From 9d4289ea256db682a6c4f85daf033fdb9522cc03 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 Jun 2012 21:02:55 +0300 Subject: Fixed check for empty error message in tooltip (#8425) --- src/com/vaadin/terminal/gwt/client/TooltipInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/TooltipInfo.java b/src/com/vaadin/terminal/gwt/client/TooltipInfo.java index 1ad1ea43cd..712d263695 100644 --- a/src/com/vaadin/terminal/gwt/client/TooltipInfo.java +++ b/src/com/vaadin/terminal/gwt/client/TooltipInfo.java @@ -45,7 +45,7 @@ public class TooltipInfo { */ public boolean hasMessage() { return (title != null && !title.isEmpty()) - || (errorMessageHtml != null && errorMessageHtml.isEmpty()); + || (errorMessageHtml != null && !errorMessageHtml.isEmpty()); } public boolean equals(TooltipInfo other) { -- cgit v1.2.3 From fca1779772808cda5d1dc5d75688069362d2b993 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 Jun 2012 21:36:43 +0300 Subject: Send the initial browser window size with the first server request (#9017) --- src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java index 1a62e566ad..d6e75c2d67 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java @@ -246,6 +246,11 @@ public class RootConnector extends AbstractComponentContainerConnector getWidget().currentFragment, false); } + if (firstPaint) { + // Queue the initial window size to be sent with the following + // request. + getWidget().performSizeCheck(); + } getWidget().rendering = false; } -- cgit v1.2.3 From 48568efd17766c26d55e8c20d73abdd9c6b30dac Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 28 Jun 2012 22:18:01 +0300 Subject: Preload translated url instead of loading raw url (#9044) --- src/com/vaadin/terminal/gwt/client/ApplicationConnection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 1308e7aac7..52b83a6e67 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -1680,7 +1680,8 @@ public class ApplicationConnection { // Preload all remaining for (int i = 0; i < dependencies.length(); i++) { - loader.loadScript(dependencies.get(i), null); + String preloadUrl = translateVaadinUri(dependencies.get(i)); + loader.preloadResource(preloadUrl, null); } } -- cgit v1.2.3 From 0419835823ab554694cb3cf98e22cb7843c7aab1 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 25 Jun 2012 11:47:49 +0000 Subject: #8957 Ensure non-negative width svn changeset:23973/svn branch:6.8 --- .../terminal/gwt/client/ui/table/VScrollTable.java | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java index b5f10e68ec..4021fc1230 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java @@ -3288,20 +3288,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets, DOM.setStyleAttribute(captionContainer, "width", ""); setWidth(""); } else { - /* * Reduce width with one pixel for the right border since the * footers does not have any spacers between them. */ - int borderWidths = 1; + final int borderWidths = 1; // Set the container width (check for negative value) - if (w - borderWidths >= 0) { - captionContainer.getStyle().setPropertyPx("width", - w - borderWidths); - } else { - captionContainer.getStyle().setPropertyPx("width", 0); - } + captionContainer.getStyle().setPropertyPx("width", + Math.max(w - borderWidths, 0)); /* * if we already have tBody, set the header width properly, if @@ -3309,22 +3304,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * unless TD width is not explicitly set. */ if (scrollBody != null) { - /* - * Reduce with one since footer does not have any spacers, - * instead a 1 pixel border. - */ int tdWidth = width + scrollBody.getCellExtraWidth() - borderWidths; - setWidth(tdWidth + "px"); + setWidth(Math.max(tdWidth, 0) + "px"); } else { Scheduler.get().scheduleDeferred(new Command() { public void execute() { - int borderWidths = 1; int tdWidth = width + scrollBody.getCellExtraWidth() - borderWidths; - setWidth(tdWidth + "px"); + setWidth(Math.max(tdWidth, 0) + "px"); } }); } -- cgit v1.2.3 From 71341fe761e67d6525265ed9407eb2d2adb1781f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 Jun 2012 22:07:53 +0300 Subject: CRLF -> LF --- .../vaadin/terminal/gwt/client/SuperDevMode.java | 494 +++++------ .../components/AddRemoveSetStyleNamesTest.html | 912 ++++++++++----------- 2 files changed, 703 insertions(+), 703 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java index 77a82c9aaf..e94aea4ae1 100644 --- a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java +++ b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java @@ -1,247 +1,247 @@ -package com.vaadin.terminal.gwt.client; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.http.client.UrlBuilder; -import com.google.gwt.jsonp.client.JsonpRequestBuilder; -import com.google.gwt.storage.client.Storage; -import com.google.gwt.user.client.Window.Location; -import com.google.gwt.user.client.rpc.AsyncCallback; -import com.vaadin.terminal.gwt.client.ui.notification.VNotification; -import com.vaadin.terminal.gwt.client.ui.notification.VNotification.EventListener; -import com.vaadin.terminal.gwt.client.ui.notification.VNotification.HideEvent; - -/** - * Class that enables SuperDevMode using a ?superdevmode parameter in the url. - * - * @author Vaadin Ltd - * @version @VERSION@ - * @since 7.0 - * - */ -public class SuperDevMode { - - private static final int COMPILE_TIMEOUT_IN_SECONDS = 60; - protected static final String SKIP_RECOMPILE = "VaadinSuperDevMode_skip_recompile"; - - public static class RecompileResult extends JavaScriptObject { - protected RecompileResult() { - - } - - public final native boolean ok() - /*-{ - return this.status == "ok"; - }-*/; - } - - private static void recompileWidgetsetAndStartInDevMode( - final String serverUrl) { - VConsole.log("Recompiling widgetset using
    " + serverUrl - + "
    and then reloading in super dev mode"); - VNotification n = new VNotification(); - n.show("Recompiling widgetset, this should not take too long", - VNotification.CENTERED, VNotification.STYLE_SYSTEM); - - JsonpRequestBuilder b = new JsonpRequestBuilder(); - b.setCallbackParam("_callback"); - b.setTimeout(COMPILE_TIMEOUT_IN_SECONDS * 1000); - b.requestObject(serverUrl + "recompile/" + GWT.getModuleName() + "?" - + getRecompileParameters(GWT.getModuleName()), - new AsyncCallback() { - - public void onSuccess(RecompileResult result) { - VConsole.log("JSONP compile call successful"); - - if (!result.ok()) { - VConsole.log("* result: " + result); - failed(); - return; - } - - setSession( - getSuperDevModeHookKey(), - getSuperDevWidgetSetUrl(GWT.getModuleName(), - serverUrl)); - setSession(SKIP_RECOMPILE, "1"); - - VConsole.log("* result: OK. Reloading"); - Location.reload(); - } - - public void onFailure(Throwable caught) { - VConsole.error("JSONP compile call failed"); - // Don't log exception as they are shown as - // notifications - VConsole.error(Util.getSimpleName(caught) + ": " - + caught.getMessage()); - failed(); - - } - - private void failed() { - VNotification n = new VNotification(); - n.addEventListener(new EventListener() { - - public void notificationHidden(HideEvent event) { - recompileWidgetsetAndStartInDevMode(serverUrl); - } - }); - n.show("Recompilation failed.
    " - + "Make sure CodeServer is running, " - + "check its output and click to retry", - VNotification.CENTERED, - VNotification.STYLE_SYSTEM); - } - }); - - } - - protected static String getSuperDevWidgetSetUrl(String widgetsetName, - String serverUrl) { - return serverUrl + GWT.getModuleName() + "/" + GWT.getModuleName() - + ".nocache.js"; - } - - private native static String getRecompileParameters(String moduleName) - /*-{ - var prop_map = $wnd.__gwt_activeModules[moduleName].bindings(); - - // convert map to URL parameter string - var props = []; - for (var key in prop_map) { - props.push(encodeURIComponent(key) + '=' + encodeURIComponent(prop_map[key])) - } - - return props.join('&') + '&'; - }-*/; - - private static void setSession(String key, String value) { - Storage.getSessionStorageIfSupported().setItem(key, value); - } - - private static String getSession(String key) { - return Storage.getSessionStorageIfSupported().getItem(key); - } - - private static void removeSession(String key) { - Storage.getSessionStorageIfSupported().removeItem(key); - } - - protected static void disableDevModeAndReload() { - removeSession(getSuperDevModeHookKey()); - redirect(false); - } - - protected static void redirect(boolean devModeOn) { - UrlBuilder createUrlBuilder = Location.createUrlBuilder(); - if (!devModeOn) { - createUrlBuilder.removeParameter("superdevmode"); - } else { - createUrlBuilder.setParameter("superdevmode", ""); - } - - Location.assign(createUrlBuilder.buildString()); - - } - - private static String getSuperDevModeHookKey() { - String widgetsetName = GWT.getModuleName(); - final String superDevModeKey = "__gwtDevModeHook:" + widgetsetName; - return superDevModeKey; - } - - private static boolean hasSession(String key) { - return getSession(key) != null; - } - - /** - * The URL of the code server. The default URL (http://localhost:9876/) will - * be used if this is empty or null. - * - * @param serverUrl - * The url of the code server or null to use the default - * @return true if recompile started, false if we are running in - * SuperDevMode - */ - protected static boolean recompileIfNeeded(String serverUrl) { - if (serverUrl == null || "".equals(serverUrl)) { - serverUrl = "http://localhost:9876/"; - } else { - serverUrl = "http://" + serverUrl + "/"; - } - - if (hasSession(SKIP_RECOMPILE)) { - VConsole.log("Running in SuperDevMode"); - // When we get here, we are running in super dev mode - - // Remove the flag so next reload will recompile - removeSession(SKIP_RECOMPILE); - - // Remove the gwt flag so we will not end up in dev mode if we - // remove the url parameter manually - removeSession(getSuperDevModeHookKey()); - - return false; - } - - recompileWidgetsetAndStartInDevMode(serverUrl); - return true; - } - - protected static boolean isSuperDevModeEnabledInModule() { - String moduleName = GWT.getModuleName(); - return isSuperDevModeEnabledInModule(moduleName); - } - - protected native static boolean isSuperDevModeEnabledInModule( - String moduleName) - /*-{ - if (!$wnd.__gwt_activeModules) - return false; - var mod = $wnd.__gwt_activeModules[moduleName]; - if (!mod) - return false; - - if (mod.superdevmode) { - // Running in super dev mode already, it is supported - return true; - } - - return mod.canRedirect; - }-*/; - - /** - * Enables SuperDevMode if the url contains the "superdevmode" parameter. - *

    - * The caller should not continue initialization of the application if this - * method returns true. The application will be restarted once compilation - * is done and then this method will return false. - *

    - * - * @return true if a recompile operation has started and the page will be - * reloaded once it is done, false if no recompilation will be done. - */ - public static boolean enableBasedOnParameter() { - String superDevModeParameter = Location.getParameter("superdevmode"); - if (superDevModeParameter != null) { - // Need to check the recompile flag also because if we are running - // in super dev mode, as a result of the recompile, the enabled - // check will fail... - if (!isSuperDevModeEnabledInModule()) { - showError("SuperDevMode is not enabled for this module/widgetset.
    " - + "Ensure that your module definition (.gwt.xml) contains
    " - + "<add-linker name="xsiframe"/>
    " - + "<set-configuration-property name="devModeRedirectEnabled" value="true" />
    "); - return false; - } - return SuperDevMode.recompileIfNeeded(superDevModeParameter); - } - return false; - } - - private static void showError(String message) { - VNotification n = new VNotification(); - n.show(message, VNotification.CENTERED_TOP, VNotification.STYLE_SYSTEM); - } -} +package com.vaadin.terminal.gwt.client; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.http.client.UrlBuilder; +import com.google.gwt.jsonp.client.JsonpRequestBuilder; +import com.google.gwt.storage.client.Storage; +import com.google.gwt.user.client.Window.Location; +import com.google.gwt.user.client.rpc.AsyncCallback; +import com.vaadin.terminal.gwt.client.ui.notification.VNotification; +import com.vaadin.terminal.gwt.client.ui.notification.VNotification.EventListener; +import com.vaadin.terminal.gwt.client.ui.notification.VNotification.HideEvent; + +/** + * Class that enables SuperDevMode using a ?superdevmode parameter in the url. + * + * @author Vaadin Ltd + * @version @VERSION@ + * @since 7.0 + * + */ +public class SuperDevMode { + + private static final int COMPILE_TIMEOUT_IN_SECONDS = 60; + protected static final String SKIP_RECOMPILE = "VaadinSuperDevMode_skip_recompile"; + + public static class RecompileResult extends JavaScriptObject { + protected RecompileResult() { + + } + + public final native boolean ok() + /*-{ + return this.status == "ok"; + }-*/; + } + + private static void recompileWidgetsetAndStartInDevMode( + final String serverUrl) { + VConsole.log("Recompiling widgetset using
    " + serverUrl + + "
    and then reloading in super dev mode"); + VNotification n = new VNotification(); + n.show("Recompiling widgetset, this should not take too long", + VNotification.CENTERED, VNotification.STYLE_SYSTEM); + + JsonpRequestBuilder b = new JsonpRequestBuilder(); + b.setCallbackParam("_callback"); + b.setTimeout(COMPILE_TIMEOUT_IN_SECONDS * 1000); + b.requestObject(serverUrl + "recompile/" + GWT.getModuleName() + "?" + + getRecompileParameters(GWT.getModuleName()), + new AsyncCallback() { + + public void onSuccess(RecompileResult result) { + VConsole.log("JSONP compile call successful"); + + if (!result.ok()) { + VConsole.log("* result: " + result); + failed(); + return; + } + + setSession( + getSuperDevModeHookKey(), + getSuperDevWidgetSetUrl(GWT.getModuleName(), + serverUrl)); + setSession(SKIP_RECOMPILE, "1"); + + VConsole.log("* result: OK. Reloading"); + Location.reload(); + } + + public void onFailure(Throwable caught) { + VConsole.error("JSONP compile call failed"); + // Don't log exception as they are shown as + // notifications + VConsole.error(Util.getSimpleName(caught) + ": " + + caught.getMessage()); + failed(); + + } + + private void failed() { + VNotification n = new VNotification(); + n.addEventListener(new EventListener() { + + public void notificationHidden(HideEvent event) { + recompileWidgetsetAndStartInDevMode(serverUrl); + } + }); + n.show("Recompilation failed.
    " + + "Make sure CodeServer is running, " + + "check its output and click to retry", + VNotification.CENTERED, + VNotification.STYLE_SYSTEM); + } + }); + + } + + protected static String getSuperDevWidgetSetUrl(String widgetsetName, + String serverUrl) { + return serverUrl + GWT.getModuleName() + "/" + GWT.getModuleName() + + ".nocache.js"; + } + + private native static String getRecompileParameters(String moduleName) + /*-{ + var prop_map = $wnd.__gwt_activeModules[moduleName].bindings(); + + // convert map to URL parameter string + var props = []; + for (var key in prop_map) { + props.push(encodeURIComponent(key) + '=' + encodeURIComponent(prop_map[key])) + } + + return props.join('&') + '&'; + }-*/; + + private static void setSession(String key, String value) { + Storage.getSessionStorageIfSupported().setItem(key, value); + } + + private static String getSession(String key) { + return Storage.getSessionStorageIfSupported().getItem(key); + } + + private static void removeSession(String key) { + Storage.getSessionStorageIfSupported().removeItem(key); + } + + protected static void disableDevModeAndReload() { + removeSession(getSuperDevModeHookKey()); + redirect(false); + } + + protected static void redirect(boolean devModeOn) { + UrlBuilder createUrlBuilder = Location.createUrlBuilder(); + if (!devModeOn) { + createUrlBuilder.removeParameter("superdevmode"); + } else { + createUrlBuilder.setParameter("superdevmode", ""); + } + + Location.assign(createUrlBuilder.buildString()); + + } + + private static String getSuperDevModeHookKey() { + String widgetsetName = GWT.getModuleName(); + final String superDevModeKey = "__gwtDevModeHook:" + widgetsetName; + return superDevModeKey; + } + + private static boolean hasSession(String key) { + return getSession(key) != null; + } + + /** + * The URL of the code server. The default URL (http://localhost:9876/) will + * be used if this is empty or null. + * + * @param serverUrl + * The url of the code server or null to use the default + * @return true if recompile started, false if we are running in + * SuperDevMode + */ + protected static boolean recompileIfNeeded(String serverUrl) { + if (serverUrl == null || "".equals(serverUrl)) { + serverUrl = "http://localhost:9876/"; + } else { + serverUrl = "http://" + serverUrl + "/"; + } + + if (hasSession(SKIP_RECOMPILE)) { + VConsole.log("Running in SuperDevMode"); + // When we get here, we are running in super dev mode + + // Remove the flag so next reload will recompile + removeSession(SKIP_RECOMPILE); + + // Remove the gwt flag so we will not end up in dev mode if we + // remove the url parameter manually + removeSession(getSuperDevModeHookKey()); + + return false; + } + + recompileWidgetsetAndStartInDevMode(serverUrl); + return true; + } + + protected static boolean isSuperDevModeEnabledInModule() { + String moduleName = GWT.getModuleName(); + return isSuperDevModeEnabledInModule(moduleName); + } + + protected native static boolean isSuperDevModeEnabledInModule( + String moduleName) + /*-{ + if (!$wnd.__gwt_activeModules) + return false; + var mod = $wnd.__gwt_activeModules[moduleName]; + if (!mod) + return false; + + if (mod.superdevmode) { + // Running in super dev mode already, it is supported + return true; + } + + return mod.canRedirect; + }-*/; + + /** + * Enables SuperDevMode if the url contains the "superdevmode" parameter. + *

    + * The caller should not continue initialization of the application if this + * method returns true. The application will be restarted once compilation + * is done and then this method will return false. + *

    + * + * @return true if a recompile operation has started and the page will be + * reloaded once it is done, false if no recompilation will be done. + */ + public static boolean enableBasedOnParameter() { + String superDevModeParameter = Location.getParameter("superdevmode"); + if (superDevModeParameter != null) { + // Need to check the recompile flag also because if we are running + // in super dev mode, as a result of the recompile, the enabled + // check will fail... + if (!isSuperDevModeEnabledInModule()) { + showError("SuperDevMode is not enabled for this module/widgetset.
    " + + "Ensure that your module definition (.gwt.xml) contains
    " + + "<add-linker name="xsiframe"/>
    " + + "<set-configuration-property name="devModeRedirectEnabled" value="true" />
    "); + return false; + } + return SuperDevMode.recompileIfNeeded(superDevModeParameter); + } + return false; + } + + private static void showError(String message) { + VNotification n = new VNotification(); + n.show(message, VNotification.CENTERED_TOP, VNotification.STYLE_SYSTEM); + } +} diff --git a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html index a09a1e06e5..512140cc6d 100644 --- a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html +++ b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html @@ -1,456 +1,456 @@ - - - - - - -AddRemoveSetStyleNamesTest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AddRemoveSetStyleNamesTest
    openrun/com.vaadin.tests.components.AddRemoveSetStyleNamesTest?restartApplication
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    - - + + + + + + +AddRemoveSetStyleNamesTest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AddRemoveSetStyleNamesTest
    openrun/com.vaadin.tests.components.AddRemoveSetStyleNamesTest?restartApplication
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style2
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style2
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style2
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]v-datefield-thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]thestyle
    mouseClickvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-style1
    assertCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]style1
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]v-datefield-popup-thestyle
    assertNotCSSClassvaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]thestyle
    + + -- cgit v1.2.3 From d5144d7e765784a90f70828c260a0a55e3713e47 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Thu, 28 Jun 2012 22:19:33 +0300 Subject: Avoid calling layoutNow() during state change (#9017) --- src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java | 2 +- src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java index d6e75c2d67..2371fb1140 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java @@ -249,7 +249,7 @@ public class RootConnector extends AbstractComponentContainerConnector if (firstPaint) { // Queue the initial window size to be sent with the following // request. - getWidget().performSizeCheck(); + getWidget().sendClientResized(); } getWidget().rendering = false; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java b/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java index 0af8919280..142a0fd89c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java @@ -395,7 +395,7 @@ public class VRoot extends SimplePanel implements ResizeHandler, /** * Send new dimensions to the server. */ - private void sendClientResized() { + void sendClientResized() { Element parentElement = getElement().getParentElement(); int viewHeight = parentElement.getClientHeight(); int viewWidth = parentElement.getClientWidth(); -- cgit v1.2.3 From e49e13eeb53719f42f7f58ce202c57ea65a56181 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 09:54:51 +0300 Subject: Added rootId to stream variables URLs (#9034) --- src/com/vaadin/Application.java | 14 +++++++++ .../vaadin/terminal/AbstractClientConnector.java | 2 +- .../gwt/server/AbstractApplicationPortlet.java | 6 ++-- .../gwt/server/AbstractApplicationServlet.java | 8 ++---- .../gwt/server/AbstractCommunicationManager.java | 27 ++++++++++-------- .../terminal/gwt/server/ClientConnector.java | 9 ++++++ .../terminal/gwt/server/CommunicationManager.java | 33 +++++++++++++--------- .../terminal/gwt/server/DragAndDropService.java | 5 ++++ .../terminal/gwt/server/JsonPaintTarget.java | 5 ++-- .../gwt/server/PortletCommunicationManager.java | 19 +++++++++---- 10 files changed, 86 insertions(+), 42 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index 84a8df5053..468a7ee8be 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -2373,4 +2373,18 @@ public class Application implements Terminal.ErrorListener, Serializable { private static final Logger getLogger() { return Logger.getLogger(Application.class.getName()); } + + /** + * Returns a Root with the given id. + *

    + * This is meant for framework internal use. + *

    + * + * @param rootId + * The root id + * @return The root with the given id or null if not found + */ + public Root getRootById(int rootId) { + return roots.get(rootId); + } } diff --git a/src/com/vaadin/terminal/AbstractClientConnector.java b/src/com/vaadin/terminal/AbstractClientConnector.java index 9de444d70e..752b5326fc 100644 --- a/src/com/vaadin/terminal/AbstractClientConnector.java +++ b/src/com/vaadin/terminal/AbstractClientConnector.java @@ -322,7 +322,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * @return the Root ancestor of this connector, or null if none * is found. */ - protected Root getRoot() { + public Root getRoot() { ClientConnector connector = this; while (connector != null) { if (connector instanceof Root) { diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index c2f887674a..acfc926d68 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -638,8 +638,10 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet /* Handle the request */ if (requestType == RequestType.FILE_UPLOAD) { - applicationManager.handleFileUpload(root, wrappedRequest, - wrappedResponse); + // Root is resolved in handleFileUpload by + // PortletCommunicationManager + applicationManager.handleFileUpload(application, + wrappedRequest, wrappedResponse); return; } else if (requestType == RequestType.BROWSER_DETAILS) { applicationManager.handleBrowserDetailsRequest( diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 7d88b432f4..f61f40dccc 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -436,11 +436,9 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements /* Handle the request */ if (requestType == RequestType.FILE_UPLOAD) { - Root root = application.getRootForRequest(request); - if (root == null) { - throw new ServletException(ERROR_NO_ROOT_FOUND); - } - applicationManager.handleFileUpload(root, request, response); + // Root is resolved in communication manager + applicationManager.handleFileUpload(application, request, + response); return; } else if (requestType == RequestType.UIDL) { Root root = application.getRootForRequest(request); diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index ba17822813..d71ab7f892 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -212,7 +212,7 @@ public abstract class AbstractCommunicationManager implements Serializable { */ protected void doHandleSimpleMultipartFileUpload(WrappedRequest request, WrappedResponse response, StreamVariable streamVariable, - String variableName, Connector owner, String boundary) + String variableName, ClientConnector owner, String boundary) throws IOException { // multipart parsing, supports only one file for request, but that is // fine for our current terminal @@ -275,14 +275,16 @@ public abstract class AbstractCommunicationManager implements Serializable { final String mimeType = rawMimeType; try { - /* - * safe cast as in GWT terminal all variable owners are expected to - * be components. - */ - Component component = (Component) owner; - if (component.isReadOnly()) { + // TODO Shouldn't this check connectorEnabled? + if (owner == null) { throw new UploadException( - "Warning: file upload ignored because the componente was read-only"); + "File upload ignored because the connector for the stream variable was not found"); + } + if (owner instanceof Component) { + if (((Component) owner).isReadOnly()) { + throw new UploadException( + "Warning: file upload ignored because the componente was read-only"); + } } boolean forgetVariable = streamToReceiver(simpleMultiPartReader, streamVariable, filename, mimeType, contentLength); @@ -311,7 +313,7 @@ public abstract class AbstractCommunicationManager implements Serializable { */ protected void doHandleXhrFilePost(WrappedRequest request, WrappedResponse response, StreamVariable streamVariable, - String variableName, Connector owner, int contentLength) + String variableName, ClientConnector owner, int contentLength) throws IOException { // These are unknown in filexhr ATM, maybe add to Accept header that @@ -2273,10 +2275,11 @@ public abstract class AbstractCommunicationManager implements Serializable { } - abstract String getStreamVariableTargetUrl(Connector owner, String name, - StreamVariable value); + abstract String getStreamVariableTargetUrl(ClientConnector owner, + String name, StreamVariable value); - abstract protected void cleanStreamVariable(Connector owner, String name); + abstract protected void cleanStreamVariable(ClientConnector owner, + String name); /** * Gets the bootstrap handler that should be used for generating the pages diff --git a/src/com/vaadin/terminal/gwt/server/ClientConnector.java b/src/com/vaadin/terminal/gwt/server/ClientConnector.java index dfdd58879d..ca1ad349c1 100644 --- a/src/com/vaadin/terminal/gwt/server/ClientConnector.java +++ b/src/com/vaadin/terminal/gwt/server/ClientConnector.java @@ -12,6 +12,7 @@ import com.vaadin.terminal.gwt.client.Connector; import com.vaadin.terminal.gwt.client.communication.SharedState; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; +import com.vaadin.ui.Root; /** * Interface implemented by all connectors that are capable of communicating @@ -136,4 +137,12 @@ public interface ClientConnector extends Connector, RpcTarget { * the extension to remove. */ public void removeExtension(Extension extension); + + /** + * Returns the root this connector is attached to + * + * @return The Root this connector is attached to or null if it is not + * attached to any Root + */ + public Root getRoot(); } diff --git a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java index 2d2888e034..2cf3b23446 100644 --- a/src/com/vaadin/terminal/gwt/server/CommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/CommunicationManager.java @@ -20,7 +20,6 @@ import com.vaadin.terminal.PaintException; import com.vaadin.terminal.StreamVariable; import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.WrappedResponse; -import com.vaadin.terminal.gwt.client.Connector; import com.vaadin.ui.Root; /** @@ -72,12 +71,13 @@ public class CommunicationManager extends AbstractCommunicationManager { * @throws IOException * @throws InvalidUIDLSecurityKeyException */ - public void handleFileUpload(Root root, WrappedRequest request, - WrappedResponse response) throws IOException, - InvalidUIDLSecurityKeyException { + public void handleFileUpload(Application application, + WrappedRequest request, WrappedResponse response) + throws IOException, InvalidUIDLSecurityKeyException { /* - * URI pattern: APP/UPLOAD/[PID]/[NAME]/[SECKEY] See #createReceiverUrl + * URI pattern: APP/UPLOAD/[ROOTID]/[PID]/[NAME]/[SECKEY] See + * #createReceiverUrl */ String pathInfo = request.getRequestPathInfo(); @@ -86,16 +86,20 @@ public class CommunicationManager extends AbstractCommunicationManager { .indexOf(AbstractApplicationServlet.UPLOAD_URL_PREFIX) + AbstractApplicationServlet.UPLOAD_URL_PREFIX.length(); String uppUri = pathInfo.substring(startOfData); - String[] parts = uppUri.split("/", 3); // 0 = pid, 1= name, 2 = sec key - String variableName = parts[1]; - String connectorId = parts[0]; + String[] parts = uppUri.split("/", 4); // 0= rootid, 1 = cid, 2= name, 3 + // = sec key + String rootId = parts[0]; + String connectorId = parts[1]; + String variableName = parts[2]; + Root root = application.getRootById(Integer.parseInt(rootId)); + Root.setCurrent(root); StreamVariable streamVariable = pidToNameToStreamVariable.get( connectorId).get(variableName); String secKey = streamVariableToSeckey.get(streamVariable); - if (secKey.equals(parts[2])) { + if (secKey.equals(parts[3])) { - Connector source = getConnector(root, connectorId); + ClientConnector source = getConnector(root, connectorId); String contentType = request.getContentType(); if (contentType.contains("boundary")) { // Multipart requests contain boundary string @@ -143,13 +147,13 @@ public class CommunicationManager extends AbstractCommunicationManager { private Map streamVariableToSeckey; @Override - String getStreamVariableTargetUrl(Connector owner, String name, + String getStreamVariableTargetUrl(ClientConnector owner, String name, StreamVariable value) { /* * We will use the same APP/* URI space as ApplicationResources but * prefix url with UPLOAD * - * eg. APP/UPLOAD/[PID]/[NAME]/[SECKEY] + * eg. APP/UPLOAD/[ROOTID]/[PID]/[NAME]/[SECKEY] * * SECKEY is created on each paint to make URL's unpredictable (to * prevent CSRF attacks). @@ -158,7 +162,8 @@ public class CommunicationManager extends AbstractCommunicationManager { * handling post */ String paintableId = owner.getConnectorId(); - String key = paintableId + "/" + name; + int rootId = owner.getRoot().getRootId(); + String key = rootId + "/" + paintableId + "/" + name; if (pidToNameToStreamVariable == null) { pidToNameToStreamVariable = new HashMap>(); @@ -186,7 +191,7 @@ public class CommunicationManager extends AbstractCommunicationManager { } @Override - protected void cleanStreamVariable(Connector owner, String name) { + protected void cleanStreamVariable(ClientConnector owner, String name) { Map nameToStreamVar = pidToNameToStreamVariable .get(owner.getConnectorId()); nameToStreamVar.remove("name"); diff --git a/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/src/com/vaadin/terminal/gwt/server/DragAndDropService.java index 0e8d1c0152..8e0346f6af 100644 --- a/src/com/vaadin/terminal/gwt/server/DragAndDropService.java +++ b/src/com/vaadin/terminal/gwt/server/DragAndDropService.java @@ -26,6 +26,7 @@ import com.vaadin.terminal.gwt.client.communication.SharedState; import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager; import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager.DragEventType; import com.vaadin.ui.Component; +import com.vaadin.ui.Root; public class DragAndDropService implements VariableOwner, ClientConnector { @@ -287,4 +288,8 @@ public class DragAndDropService implements VariableOwner, ClientConnector { private Logger getLogger() { return Logger.getLogger(DragAndDropService.class.getName()); } + + public Root getRoot() { + return null; + } } diff --git a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java index 70ab452e4e..15b5ced703 100644 --- a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java +++ b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java @@ -24,7 +24,6 @@ import com.vaadin.terminal.Resource; import com.vaadin.terminal.StreamVariable; import com.vaadin.terminal.ThemeResource; import com.vaadin.terminal.VariableOwner; -import com.vaadin.terminal.gwt.client.Connector; import com.vaadin.ui.Alignment; import com.vaadin.ui.Component; import com.vaadin.ui.CustomLayout; @@ -992,8 +991,8 @@ public class JsonPaintTarget implements PaintTarget { public void addVariable(VariableOwner owner, String name, StreamVariable value) throws PaintException { - String url = manager.getStreamVariableTargetUrl((Connector) owner, - name, value); + String url = manager.getStreamVariableTargetUrl( + (ClientConnector) owner, name, value); if (url != null) { addVariable(owner, name, url); } // else { //NOP this was just a cleanup by component } diff --git a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java index 7398315ee2..d45e652110 100644 --- a/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java @@ -43,12 +43,19 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { super(application); } - public void handleFileUpload(Root root, WrappedRequest request, - WrappedResponse response) throws IOException { + public void handleFileUpload(Application application, + WrappedRequest request, WrappedResponse response) + throws IOException { String contentType = request.getContentType(); String name = request.getParameter("name"); String ownerId = request.getParameter("rec-owner"); - Connector owner = getConnector(root, ownerId); + String rootId = request.getParameter("rootId"); + + Root root = application.getRootById(Integer.parseInt(rootId)); + Root.setCurrent(root); + + ClientConnector owner = getConnector(root, ownerId); + StreamVariable streamVariable = ownerToNameToStreamVariable.get(owner) .get(name); @@ -123,7 +130,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { private Map> ownerToNameToStreamVariable; @Override - String getStreamVariableTargetUrl(Connector owner, String name, + String getStreamVariableTargetUrl(ClientConnector owner, String name, StreamVariable value) { if (ownerToNameToStreamVariable == null) { ownerToNameToStreamVariable = new HashMap>(); @@ -139,8 +146,10 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { resurl.setResourceID("UPLOAD"); resurl.setParameter("name", name); resurl.setParameter("rec-owner", owner.getConnectorId()); + resurl.setParameter("rootId", "" + owner.getRoot().getRootId()); resurl.setProperty("name", name); resurl.setProperty("rec-owner", owner.getConnectorId()); + resurl.setProperty("rootId", "" + owner.getRoot().getRootId()); return resurl.toString(); } @@ -153,7 +162,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager { } @Override - protected void cleanStreamVariable(Connector owner, String name) { + protected void cleanStreamVariable(ClientConnector owner, String name) { Map map = ownerToNameToStreamVariable .get(owner); map.remove(name); -- cgit v1.2.3 From 70d24586893359e35b0fc532916acb95653890a7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 10:35:00 +0300 Subject: Add v-datefield-day instead of prefixed for compatibility (#8664) --- .../client/ui/datefield/AbstractDateFieldConnector.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java index 72555214fa..f9d02d403b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java @@ -64,15 +64,21 @@ public class AbstractDateFieldConnector extends AbstractFieldConnector } // Remove old stylename that indicates current resolution - setWidgetStyleNameWithPrefix(VDateField.CLASSNAME, - VDateField.resolutionToString(getWidget().currentResolution), + setWidgetStyleName( + VDateField.CLASSNAME + + "-" + + VDateField + .resolutionToString(getWidget().currentResolution), false); getWidget().currentResolution = newResolution; // Add stylename that indicates current resolution - setWidgetStyleNameWithPrefix(VDateField.CLASSNAME, - VDateField.resolutionToString(getWidget().currentResolution), + setWidgetStyleName( + VDateField.CLASSNAME + + "-" + + VDateField + .resolutionToString(getWidget().currentResolution), true); final int year = uidl.getIntVariable("year"); -- cgit v1.2.3 From 337361d463efcf55b854170c6ce995dcd59fc96c Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 12:05:34 +0300 Subject: paintable -> connector --- src/com/vaadin/terminal/gwt/client/Util.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index d3cb54160d..00bf144803 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -644,17 +644,17 @@ public class Util { ApplicationConnection client, Widget parent, Element element) { Element rootElement = parent.getElement(); while (element != null && element != rootElement) { - ComponentConnector paintable = ConnectorMap.get(client) + ComponentConnector connector = ConnectorMap.get(client) .getConnector(element); - if (paintable == null) { + if (connector == null) { String ownerPid = VCaption.getCaptionOwnerPid(element); if (ownerPid != null) { - paintable = (ComponentConnector) ConnectorMap.get(client) + connector = (ComponentConnector) ConnectorMap.get(client) .getConnector(ownerPid); } } - if (paintable != null) { + if (connector != null) { // check that inside the rootElement while (element != null && element != rootElement) { element = (Element) element.getParentElement(); @@ -662,7 +662,7 @@ public class Util { if (element != rootElement) { return null; } else { - return paintable; + return connector; } } -- cgit v1.2.3 From 6dec84ebe934f001488797c2b90c347635b54b6f Mon Sep 17 00:00:00 2001 From: Sami Viitanen Date: Fri, 29 Jun 2012 12:07:30 +0300 Subject: Made MenuBar item tooltips work again (#8425) --- src/com/vaadin/terminal/gwt/client/Util.java | 28 +++++++--- .../vaadin/terminal/gwt/client/ui/VOverlay.java | 28 ++++++++++ .../gwt/client/ui/menubar/MenuBarConnector.java | 25 +++++++++ .../terminal/gwt/client/ui/menubar/VMenuBar.java | 64 +++++++++++++++++----- 4 files changed, 125 insertions(+), 20 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index 00bf144803..4687512b47 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -29,6 +29,7 @@ import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.RenderInformation.FloatSize; import com.vaadin.terminal.gwt.client.communication.MethodInvocation; +import com.vaadin.terminal.gwt.client.ui.VOverlay; public class Util { @@ -642,12 +643,16 @@ public class Util { */ public static ComponentConnector getConnectorForElement( ApplicationConnection client, Widget parent, Element element) { + + Element browseElement = element; Element rootElement = parent.getElement(); - while (element != null && element != rootElement) { + + while (browseElement != null && browseElement != rootElement) { ComponentConnector connector = ConnectorMap.get(client) - .getConnector(element); + .getConnector(browseElement); + if (connector == null) { - String ownerPid = VCaption.getCaptionOwnerPid(element); + String ownerPid = VCaption.getCaptionOwnerPid(browseElement); if (ownerPid != null) { connector = (ComponentConnector) ConnectorMap.get(client) .getConnector(ownerPid); @@ -656,17 +661,26 @@ public class Util { if (connector != null) { // check that inside the rootElement - while (element != null && element != rootElement) { - element = (Element) element.getParentElement(); + while (browseElement != null && browseElement != rootElement) { + browseElement = (Element) browseElement.getParentElement(); } - if (element != rootElement) { + if (browseElement != rootElement) { return null; } else { return connector; } } - element = (Element) element.getParentElement(); + browseElement = (Element) browseElement.getParentElement(); + } + + if (browseElement == null) { + // Element is possibly inside a VOverlay + VOverlay overlay = findWidget(element, VOverlay.class); + if (overlay != null && overlay.getOwner() != null) { + return getConnectorForElement(client, RootPanel.get(), overlay + .getOwner().getElement()); + } } return null; diff --git a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java index df655ef959..77639c0c3f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java @@ -14,6 +14,7 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.PopupPanel; import com.google.gwt.user.client.ui.RootPanel; +import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.BrowserInfo; /** @@ -45,6 +46,12 @@ public class VOverlay extends PopupPanel implements CloseHandler { */ private Element shadow; + /* + * Creator of VOverlow (widget that made the instance, not the layout + * parent) + */ + private Widget owner; + /** * The HTML snippet that is used to render the actual shadow. In consists of * nine different DIV-elements with the following class names: @@ -414,4 +421,25 @@ public class VOverlay extends PopupPanel implements CloseHandler { protected boolean isSinkShadowEvents() { return sinkShadowEvents; } + + /** + * Get owner (Widget that made this VOverlay, not the layout parent) of + * VOverlay + * + * @return Owner (creator) or null if not defined + */ + public Widget getOwner() { + return owner; + } + + /** + * Set owner (Widget that made this VOverlay, not the layout parent) of + * VOverlay + * + * @param owner + * Owner (creator) of VOverlay + */ + public void setOwner(Widget owner) { + this.owner = owner; + } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java index d1f77aa0ff..a18e4d734a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java @@ -7,9 +7,11 @@ import java.util.Iterator; import java.util.Stack; import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Element; import com.google.gwt.user.client.Command; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.Paintable; +import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector; @@ -120,6 +122,7 @@ public class MenuBarConnector extends AbstractComponentConnector implements iteratorStack.push(itr); itr = item.getChildIterator(); currentMenu = new VMenuBar(true, currentMenu); + client.getVTooltip().connectHandlersToWidget(currentMenu); // this is the top-level style that also propagates to items - // any item specific styles are set above in // currentItem.updateFromUIDL(item, client) @@ -160,4 +163,26 @@ public class MenuBarConnector extends AbstractComponentConnector implements public void layout() { getWidget().iLayout(); } + + @Override + public TooltipInfo getTooltipInfo(Element element) { + TooltipInfo info = null; + + // Check content of widget to find tooltip for element + if (element != getWidget().getElement()) { + + CustomMenuItem item = getWidget().getMenuItemWithElement( + (com.google.gwt.user.client.Element) element); + if (item != null) { + info = item.getTooltip(); + } + } + + // Use default tooltip if nothing found from DOM three + if (info == null) { + info = super.getTooltipInfo(element); + } + + return info; + } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java index 821fa5032c..6133b7d80c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java @@ -33,6 +33,7 @@ import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ApplicationConnection; import com.vaadin.terminal.gwt.client.BrowserInfo; import com.vaadin.terminal.gwt.client.LayoutManager; +import com.vaadin.terminal.gwt.client.TooltipInfo; import com.vaadin.terminal.gwt.client.UIDL; import com.vaadin.terminal.gwt.client.Util; import com.vaadin.terminal.gwt.client.ui.Icon; @@ -87,8 +88,6 @@ public class VMenuBar extends SimpleFocusablePanel implements boolean enabled = true; - private String width = "notinited"; - private VLazyExecutor iconLoadedExecutioner = new VLazyExecutor(100, new ScheduledCommand() { @@ -524,6 +523,22 @@ public class VMenuBar extends SimpleFocusablePanel implements final int shadowSpace = 10; popup = new VOverlay(true, false, true); + + // Setting owner and handlers to support tooltips. Needed for tooltip + // handling of overlay widgets (will direct queries to parent menu) + if (parentMenu == null) { + popup.setOwner(this); + } else { + VMenuBar parent = parentMenu; + while (parent.getParentMenu() != null) { + parent = parent.getParentMenu(); + } + popup.setOwner(parent); + } + if (client != null) { + client.getVTooltip().connectHandlersToWidget(popup); + } + popup.setStyleName(CLASSNAME + "-popup"); popup.setWidget(item.getSubMenu()); popup.addCloseHandler(this); @@ -707,9 +722,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * A class to hold information on menu items * */ - protected static class CustomMenuItem extends Widget implements HasHTML { - - private ApplicationConnection client; + public static class CustomMenuItem extends Widget implements HasHTML { protected String html = null; protected Command command = null; @@ -719,6 +732,7 @@ public class VMenuBar extends SimpleFocusablePanel implements protected boolean isSeparator = false; protected boolean checkable = false; protected boolean checked = false; + protected String description = null; /** * Default menu item {@link Widget} constructor for GWT.create(). @@ -884,7 +898,6 @@ public class VMenuBar extends SimpleFocusablePanel implements } public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { - this.client = client; setSeparator(uidl.hasAttribute("separator")); setEnabled(!uidl.hasAttribute(ATTRIBUTE_ITEM_DISABLED)); @@ -903,17 +916,18 @@ public class VMenuBar extends SimpleFocusablePanel implements addStyleDependentName(itemStyle); } + if (uidl.hasAttribute(ATTRIBUTE_ITEM_DESCRIPTION)) { + description = uidl + .getStringAttribute(ATTRIBUTE_ITEM_DESCRIPTION); + } } - private VMenuBar findRootMenu() { - VMenuBar menubar = getParentMenu(); - - // Traverse up until root menu is found - while (menubar.getParentMenu() != null) { - menubar = menubar.getParentMenu(); + public TooltipInfo getTooltip() { + if (description == null) { + return null; } - return menubar; + return new TooltipInfo(description); } /** @@ -1405,4 +1419,28 @@ public class VMenuBar extends SimpleFocusablePanel implements return null; } + /** + * Get menu item with given DOM element + * + * @param element + * Element used in search + * @return Menu item or null if not found + */ + public CustomMenuItem getMenuItemWithElement(Element element) { + for (int i = 0; i < items.size(); i++) { + CustomMenuItem item = items.get(i); + if (DOM.isOrHasChild(item.getElement(), element)) { + return item; + } + + if (item.getSubMenu() != null) { + item = item.getSubMenu().getMenuItemWithElement(element); + if (item != null) { + return item; + } + } + } + + return null; + } } -- cgit v1.2.3 From cd59481319a4cc5064868c1673fb9a7cdd3f716d Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 12:08:36 +0300 Subject: Added missing license --- src/com/vaadin/terminal/gwt/client/SuperDevMode.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java index e94aea4ae1..98e73c0c08 100644 --- a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java +++ b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java @@ -1,3 +1,6 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ package com.vaadin.terminal.gwt.client; import com.google.gwt.core.client.GWT; -- cgit v1.2.3 From ef260e6b5594bf5da6399a5e468554a161201f19 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 15:20:55 +0300 Subject: Fixed problem when Table pagelength==0 and components wrap (#9067) --- src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java index 4021fc1230..e2aedd123f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java @@ -5790,7 +5790,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (isDynamicHeight() && totalRows == pageLength) { // fix body height (may vary if lazy loading is offhorizontal // scrollbar appears/disappears) - int bodyHeight = Util.getRequiredHeight(scrollBody); + int bodyHeight = scrollBody.getRequiredHeight(); boolean needsSpaceForHorizontalScrollbar = (availW < usedMinimumWidth); if (needsSpaceForHorizontalScrollbar) { bodyHeight += Util.getNativeScrollbarSize(); -- cgit v1.2.3 From 481166bc020d1bde0b2f763751a863012b4dc93a Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 16:54:49 +0300 Subject: Ensure only click events scroll tabs (#9077) --- .../terminal/gwt/client/ui/tabsheet/VTabsheet.java | 33 ++++++++++++---------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java index 24ea3b2d38..844708a892 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java @@ -685,24 +685,27 @@ public class VTabsheet extends VTabsheetBase implements Focusable, @Override public void onBrowserEvent(Event event) { + if (event.getTypeInt() == Event.ONCLICK) { + // Tab scrolling + if (isScrolledTabs() && DOM.eventGetTarget(event) == scrollerPrev) { + int newFirstIndex = tb.scrollLeft(scrollerIndex); + if (newFirstIndex != -1) { + scrollerIndex = newFirstIndex; + updateTabScroller(); + } + return; + } else if (isClippedTabs() + && DOM.eventGetTarget(event) == scrollerNext) { + int newFirstIndex = tb.scrollRight(scrollerIndex); - // Tab scrolling - if (isScrolledTabs() && DOM.eventGetTarget(event) == scrollerPrev) { - int newFirstIndex = tb.scrollLeft(scrollerIndex); - if (newFirstIndex != -1) { - scrollerIndex = newFirstIndex; - updateTabScroller(); - } - } else if (isClippedTabs() && DOM.eventGetTarget(event) == scrollerNext) { - int newFirstIndex = tb.scrollRight(scrollerIndex); - - if (newFirstIndex != -1) { - scrollerIndex = newFirstIndex; - updateTabScroller(); + if (newFirstIndex != -1) { + scrollerIndex = newFirstIndex; + updateTabScroller(); + } + return; } - } else { - super.onBrowserEvent(event); } + super.onBrowserEvent(event); } /** -- cgit v1.2.3 From 97977146b0b7f8e793b616fde8da0d8331c8e93c Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 16:57:07 +0300 Subject: GridLayout should call super.init() --- .../vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java index 2cd82313c2..f28b0237f7 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java @@ -51,6 +51,7 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector @Override public void init() { + super.init(); rpc = RpcProxy.create(GridLayoutServerRpc.class, this); getLayoutManager().registerDependency(this, getWidget().spacingMeasureElement); -- cgit v1.2.3 From 6dee4468f78a4ff3371b837634d7b1388be26b8b Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 17:24:58 +0300 Subject: TwinColSelectConnector.init() must call super.init() --- .../terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java b/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java index a77319920c..6d5cd3320e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java @@ -29,6 +29,7 @@ public class TwinColSelectConnector extends OptionGroupBaseConnector implements @Override protected void init() { + super.init(); getLayoutManager().registerDependency(this, getWidget().captionWrapper.getElement()); } -- cgit v1.2.3 From 6478caecf798594494d63092a08cfc75530947f7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 19:33:18 +0300 Subject: Ensure native method does not return undefined --- src/com/vaadin/terminal/gwt/client/SuperDevMode.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java index 98e73c0c08..02df811d51 100644 --- a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java +++ b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java @@ -211,7 +211,7 @@ public class SuperDevMode { return true; } - return mod.canRedirect; + return !!mod.canRedirect; }-*/; /** -- cgit v1.2.3 From e6bdeff520f6cda7eeb787572ff9f79cf00ff8dc Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 19:48:43 +0300 Subject: Separated part of DefaultWidgetSet to com.vaadin.Vaadin (#9078) --- src/com/vaadin/Vaadin.gwt.xml | 84 ++++++++++++++++++++++ .../vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml | 78 +------------------- ...efaultWidgetSetBrowserSpecificOverrides.gwt.xml | 53 -------------- .../gwt/VaadinBrowserSpecificOverrides.gwt.xml | 53 ++++++++++++++ 4 files changed, 138 insertions(+), 130 deletions(-) create mode 100644 src/com/vaadin/Vaadin.gwt.xml delete mode 100644 src/com/vaadin/terminal/gwt/DefaultWidgetSetBrowserSpecificOverrides.gwt.xml create mode 100644 src/com/vaadin/terminal/gwt/VaadinBrowserSpecificOverrides.gwt.xml (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/Vaadin.gwt.xml b/src/com/vaadin/Vaadin.gwt.xml new file mode 100644 index 0000000000..d702b07693 --- /dev/null +++ b/src/com/vaadin/Vaadin.gwt.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml index daa5e9f24d..278d92f38f 100644 --- a/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml +++ b/src/com/vaadin/terminal/gwt/DefaultWidgetSet.gwt.xml @@ -6,84 +6,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - diff --git a/src/com/vaadin/terminal/gwt/DefaultWidgetSetBrowserSpecificOverrides.gwt.xml b/src/com/vaadin/terminal/gwt/DefaultWidgetSetBrowserSpecificOverrides.gwt.xml deleted file mode 100644 index b5ab61df64..0000000000 --- a/src/com/vaadin/terminal/gwt/DefaultWidgetSetBrowserSpecificOverrides.gwt.xml +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/com/vaadin/terminal/gwt/VaadinBrowserSpecificOverrides.gwt.xml b/src/com/vaadin/terminal/gwt/VaadinBrowserSpecificOverrides.gwt.xml new file mode 100644 index 0000000000..b5ab61df64 --- /dev/null +++ b/src/com/vaadin/terminal/gwt/VaadinBrowserSpecificOverrides.gwt.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From c2c1270786c04ee1bd01729f72d63a6553a0b0a7 Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Fri, 29 Jun 2012 20:41:13 +0300 Subject: Don't throw NPE if there is no implementation (#9081) --- src/com/vaadin/terminal/gwt/client/VConsole.java | 30 +++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/VConsole.java b/src/com/vaadin/terminal/gwt/client/VConsole.java index dee8529a84..a221b42d67 100644 --- a/src/com/vaadin/terminal/gwt/client/VConsole.java +++ b/src/com/vaadin/terminal/gwt/client/VConsole.java @@ -57,35 +57,49 @@ public class VConsole { } public static void log(String msg) { - impl.log(msg); + if (impl != null) { + impl.log(msg); + } } public static void log(Throwable e) { - impl.log(e); + if (impl != null) { + impl.log(e); + } } public static void error(Throwable e) { - impl.error(e); + if (impl != null) { + impl.error(e); + } } public static void error(String msg) { - impl.error(msg); + if (impl != null) { + impl.error(msg); + } } public static void printObject(Object msg) { - impl.printObject(msg); + if (impl != null) { + impl.printObject(msg); + } } public static void dirUIDL(ValueMap u, ApplicationConfiguration cnf) { - impl.dirUIDL(u, cnf); + if (impl != null) { + impl.dirUIDL(u, cnf); + } } public static void printLayoutProblems(ValueMap meta, ApplicationConnection applicationConnection, Set zeroHeightComponents, Set zeroWidthComponents) { - impl.printLayoutProblems(meta, applicationConnection, - zeroHeightComponents, zeroWidthComponents); + if (impl != null) { + impl.printLayoutProblems(meta, applicationConnection, + zeroHeightComponents, zeroWidthComponents); + } } } -- cgit v1.2.3 From cbb6310058903ac5e994494ccee78363e0682505 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 3 Jul 2012 10:30:43 +0300 Subject: Support array as a generic type parameter (#8861) --- src/com/vaadin/terminal/gwt/server/JsonCodec.java | 35 ++++++++++++++++------ .../vaadin/tests/serialization/SerializerTest.java | 19 ++++++------ 2 files changed, 36 insertions(+), 18 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/server/JsonCodec.java b/src/com/vaadin/terminal/gwt/server/JsonCodec.java index d3a2ef56f8..8091a1d205 100644 --- a/src/com/vaadin/terminal/gwt/server/JsonCodec.java +++ b/src/com/vaadin/terminal/gwt/server/JsonCodec.java @@ -9,6 +9,7 @@ import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.io.Serializable; import java.lang.reflect.Array; +import java.lang.reflect.GenericArrayType; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; @@ -100,8 +101,10 @@ public class JsonCodec implements Serializable { private static Class getClassForType(Type type) { if (type instanceof ParameterizedType) { return (Class) (((ParameterizedType) type).getRawType()); - } else { + } else if (type instanceof Class) { return (Class) type; + } else { + return null; } } @@ -138,7 +141,13 @@ public class JsonCodec implements Serializable { && ((Class) targetType).isArray()) { // Legacy Object[] and String[] handled elsewhere, this takes care // of generic arrays - return decodeArray((Class) targetType, (JSONArray) value, + Class componentType = ((Class) targetType).getComponentType(); + return decodeArray(componentType, (JSONArray) value, + connectorTracker); + } else if (targetType instanceof GenericArrayType) { + Type componentType = ((GenericArrayType) targetType) + .getGenericComponentType(); + return decodeArray(componentType, (JSONArray) value, connectorTracker); } else if (targetType == JSONObject.class || targetType == JSONArray.class) { @@ -149,10 +158,10 @@ public class JsonCodec implements Serializable { } } - private static Object decodeArray(Class targetType, JSONArray value, + private static Object decodeArray(Type componentType, JSONArray value, ConnectorTracker connectorTracker) throws JSONException { - Class componentType = targetType.getComponentType(); - Object array = Array.newInstance(componentType, value.length()); + Class componentClass = getClassForType(componentType); + Object array = Array.newInstance(componentClass, value.length()); for (int i = 0; i < value.length(); i++) { Object decodedValue = decodeInternalOrCustomType(componentType, value.get(i), connectorTracker); @@ -540,7 +549,15 @@ public class JsonCodec implements Serializable { return jsonArray; } else if (valueType instanceof Class && ((Class) valueType).isArray()) { - JSONArray jsonArray = encodeArrayContents(value, connectorTracker); + JSONArray jsonArray = encodeArrayContents( + ((Class) valueType).getComponentType(), value, + connectorTracker); + return jsonArray; + } else if (valueType instanceof GenericArrayType) { + Type componentType = ((GenericArrayType) valueType) + .getGenericComponentType(); + JSONArray jsonArray = encodeArrayContents(componentType, value, + connectorTracker); return jsonArray; } else if (value instanceof Map) { Object jsonMap = encodeMap(valueType, (Map) value, @@ -643,10 +660,10 @@ public class JsonCodec implements Serializable { return e.name(); } - private static JSONArray encodeArrayContents(Object array, - ConnectorTracker connectorTracker) throws JSONException { + private static JSONArray encodeArrayContents(Type componentType, + Object array, ConnectorTracker connectorTracker) + throws JSONException { JSONArray jsonArray = new JSONArray(); - Class componentType = array.getClass().getComponentType(); for (int i = 0; i < Array.getLength(array); i++) { jsonArray.put(encode(Array.get(array, i), null, componentType, connectorTracker)); diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java index d0b672fbf9..881a3c3be1 100644 --- a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java +++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java @@ -63,13 +63,12 @@ public class SerializerTest extends AbstractTestRoot { rpc.sendList(Arrays.asList(5, 8, -234), Arrays. asList(this, testExtension), Arrays.asList(new SimpleTestBean(234), new SimpleTestBean(-568))); - // Disabled because of #8861 - // rpc.sendArrayList( - // Arrays.asList(new int[] { 1, 2 }, new int[] { 3, 4 }), - // Arrays.asList(new Integer[] { 5, 6 }, new Integer[] { 7, 8 }), - // Collections - // .singletonList(new SimpleTestBean[] { new SimpleTestBean( - // 7) })); + rpc.sendArrayList( + Arrays.asList(new int[] { 1, 2 }, new int[] { 3, 4 }), + Arrays.asList(new Integer[] { 5, 6 }, new Integer[] { 7, 8 }), + Collections + .singletonList(new SimpleTestBean[] { new SimpleTestBean( + 7) })); // Disabled because of #8861 // rpc.sendListArray( // new List[] { Arrays.asList(1, 2), Arrays.asList(3, 4) }, @@ -199,8 +198,10 @@ public class SerializerTest extends AbstractTestRoot { public void sendArrayList(List primitiveArrayList, List objectArrayList, List beanArrayList) { - log.log("sendArrayList: " + primitiveArrayList + ", " - + objectArrayList + ", " + beanArrayList); + log.log("sendArrayList: " + + Arrays.deepToString(primitiveArrayList.toArray()) + + ", " + Arrays.deepToString(objectArrayList.toArray()) + + ", " + Arrays.deepToString(beanArrayList.toArray())); } public void sendListArray(List[] objectListArray, -- cgit v1.2.3 From ab2846641bff895b9e82bfd8068c720e8132e297 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Tue, 3 Jul 2012 13:27:47 +0300 Subject: Run JavaScript RPC with this pointing to the connector wrapper (#9096) --- .../vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java | 9 +++++---- .../vaadin/tests/minitutorials/v7a3/complex_types_connector.js | 7 +++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java index 86c11fd26d..2b88867cfe 100644 --- a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java +++ b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java @@ -331,9 +331,9 @@ public class JavaScriptConnectorHelper { invokeCallback(getConnectorWrapper(), callbackName, arguments); } else { JavaScriptObject arguments = parametersJson.getJavaScriptObject(); - invokeJsRpc(rpcMap, iface, method, arguments); + invokeJsRpc(rpcMap, iface, method, arguments, getConnectorWrapper()); // Also invoke wildcard interface - invokeJsRpc(rpcMap, "", method, arguments); + invokeJsRpc(rpcMap, "", method, arguments, getConnectorWrapper()); } } @@ -344,7 +344,8 @@ public class JavaScriptConnectorHelper { }-*/; private static native void invokeJsRpc(JavaScriptObject rpcMap, - String interfaceName, String methodName, JavaScriptObject parameters) + String interfaceName, String methodName, + JavaScriptObject parameters, JavaScriptObject connector) /*-{ var targets = rpcMap[interfaceName]; if (!targets) { @@ -352,7 +353,7 @@ public class JavaScriptConnectorHelper { } for(var i = 0; i < targets.length; i++) { var target = targets[i]; - target[methodName].apply(target, parameters); + target[methodName].apply(connector, parameters); } }-*/; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js index 496afce432..85dfb1369b 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js @@ -1,9 +1,8 @@ window.com_vaadin_tests_minitutorials_v7a3_ComplexTypesComponent = function() { - var connectorId = this.getConnectorId(); - var element = this.getElement(); - this.registerRpc({ sendComplexTypes: function(list, stringMap, otherMap, connectorMap, bits, matrix, bean) { + var connectorId = this.getConnectorId(); + var message = 'list[2] = "' + list[2] + '"
    '; message += 'stringMap.two = ' + stringMap.two + '
    '; message += 'otherMap[1][1] = "' + otherMap[1][1] + '"
    '; @@ -12,7 +11,7 @@ window.com_vaadin_tests_minitutorials_v7a3_ComplexTypesComponent = function() { message += 'matrix[0][1] = ' + matrix[0][1] + '
    '; message += 'bean.bean.integer = ' + bean.bean.integer + '
    '; - element.innerHTML = message; + this.getElement().innerHTML = message; } }); } \ No newline at end of file -- cgit v1.2.3 From f419c7f2b8f7cc59b39f3368e0bb83cb71d850fc Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Wed, 4 Jul 2012 10:00:16 +0300 Subject: Correct typos in AbstractCommunicationManager --- .../vaadin/terminal/gwt/server/AbstractCommunicationManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index d71ab7f892..996ada924d 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1232,7 +1232,7 @@ public abstract class AbstractCommunicationManager implements Serializable { if ("connector".equals(protocol)) { // Strip initial slash String resourceName = uri.getPath().substring(1); - return registerConnecctorResource(resourceName, context); + return registerConnectorResource(resourceName, context); } if (protocol != null || uri.getHost() != null) { @@ -1240,7 +1240,7 @@ public abstract class AbstractCommunicationManager implements Serializable { } // Bare path interpreted as connector resource - return registerConnecctorResource(resourceUri, context); + return registerConnectorResource(resourceUri, context); } catch (URISyntaxException e) { getLogger().log(Level.WARNING, "Could not parse resource url " + resourceUri, e); @@ -1248,7 +1248,7 @@ public abstract class AbstractCommunicationManager implements Serializable { } } - private String registerConnecctorResource(String name, Class context) { + private String registerConnectorResource(String name, Class context) { synchronized (connectorResourceContexts) { // Add to map of names accepted by serveConnectorResource if (connectorResourceContexts.containsKey(name)) { @@ -2427,7 +2427,7 @@ public abstract class AbstractCommunicationManager implements Serializable { // registered in the map if (context == null) { getLogger().warning( - "Connector resource request for unkown resource rejected: " + "Connector resource request for unknown resource rejected: " + resourceName); response.sendError(HttpServletResponse.SC_NOT_FOUND, resourceName); return; -- cgit v1.2.3 From 9043c22ec506670b19e9071bbc90ca59e0c8284e Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Thu, 5 Jul 2012 12:13:21 +0300 Subject: Make findTypesWithExistingSerializers check for right signature (#9106) --- .../gwt/widgetsetutils/SerializerMapGenerator.java | 38 ++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/SerializerMapGenerator.java b/src/com/vaadin/terminal/gwt/widgetsetutils/SerializerMapGenerator.java index 5e151323a0..2da2c85d8b 100644 --- a/src/com/vaadin/terminal/gwt/widgetsetutils/SerializerMapGenerator.java +++ b/src/com/vaadin/terminal/gwt/widgetsetutils/SerializerMapGenerator.java @@ -22,12 +22,12 @@ import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.JMethod; import com.google.gwt.core.ext.typeinfo.JParameterizedType; import com.google.gwt.core.ext.typeinfo.JType; +import com.google.gwt.core.ext.typeinfo.NotFoundException; import com.google.gwt.core.ext.typeinfo.TypeOracle; -import com.google.gwt.json.client.JSONObject; +import com.google.gwt.json.client.JSONValue; import com.google.gwt.user.rebind.ClassSourceFileComposerFactory; import com.google.gwt.user.rebind.SourceWriter; import com.vaadin.terminal.gwt.client.ApplicationConnection; -import com.vaadin.terminal.gwt.client.ConnectorMap; import com.vaadin.terminal.gwt.client.communication.ClientRpc; import com.vaadin.terminal.gwt.client.communication.JSONSerializer; import com.vaadin.terminal.gwt.client.communication.SerializerMap; @@ -114,22 +114,40 @@ public class SerializerMapGenerator extends Generator { } private Set findTypesWithExistingSerializers( - TypeOracle typeOracle, TreeLogger logger) { + TypeOracle typeOracle, TreeLogger logger) + throws UnableToCompleteException { JClassType serializerInterface = typeOracle .findType(JSONSerializer.class.getName()); + JType[] deserializeParamTypes = new JType[] { + typeOracle + .findType(com.vaadin.terminal.gwt.client.communication.Type.class + .getName()), + typeOracle.findType(JSONValue.class.getName()), + typeOracle.findType(ApplicationConnection.class.getName()) }; + String deserializeMethodName = "deserialize"; + try { + serializerInterface.getMethod(deserializeMethodName, + deserializeParamTypes); + } catch (NotFoundException e) { + logger.log(Type.ERROR, "Could not find " + deserializeMethodName + + " in " + serializerInterface); + throw new UnableToCompleteException(); + } + Set types = new HashSet(); for (JClassType serializer : serializerInterface.getSubtypes()) { - JType[] deserializeParamTypes = new JType[] { - typeOracle.findType(JSONObject.class.getName()), - typeOracle.findType(ConnectorMap.class.getName()), - typeOracle.findType(ApplicationConnection.class.getName()) }; - JMethod deserializeMethod = serializer.findMethod("deserialize", - deserializeParamTypes); + JMethod deserializeMethod = serializer.findMethod( + deserializeMethodName, deserializeParamTypes); if (deserializeMethod == null) { + logger.log(Type.DEBUG, "Could not find " + + deserializeMethodName + " in " + serializer); continue; } + JType returnType = deserializeMethod.getReturnType(); + logger.log(Type.DEBUG, "Found " + deserializeMethodName + + " with return type " + returnType + " in " + serializer); - types.add(deserializeMethod.getReturnType().isClass()); + types.add(returnType.isClass()); } return types; } -- cgit v1.2.3 From 3aab8e558b60088bb6dca5e75a320ef3dc6b0aba Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 9 Jul 2012 10:13:27 +0000 Subject: #7387 Render block elements in TreeTable hierarchy column correctly: draw the expand/collapse arrow as position: absolute and use padding for indentation. Also fix typo "ident" -> "indent". svn changeset:23994/svn branch:6.8 --- .../VAADIN/themes/base/treetable/treetable.css | 14 ++++--- WebContent/VAADIN/themes/reindeer/table/table.css | 6 +-- .../vaadin/terminal/gwt/client/ui/VTreeTable.java | 44 ++++++++++++++-------- 3 files changed, 41 insertions(+), 23 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/WebContent/VAADIN/themes/base/treetable/treetable.css b/WebContent/VAADIN/themes/base/treetable/treetable.css index 1bc21b890c..662839a4a2 100644 --- a/WebContent/VAADIN/themes/base/treetable/treetable.css +++ b/WebContent/VAADIN/themes/base/treetable/treetable.css @@ -4,13 +4,13 @@ height: 10px; /* defines the amount of indent per level */ width: 18px; -} -.v-ie7 .v-treetable-treespacer{ - height: 100%; /* #7388 */ + position: absolute; + left: 0; + top: 5px; } .v-treetable-node-closed { - background: url(../treetable/img/arrow-right.png) right center no-repeat; + background: url(../treetable/img/arrow-right.png) right top no-repeat; } .v-ie6 .v-treetable-node-closed { @@ -18,7 +18,7 @@ } .v-treetable-node-open { - background: url(../treetable/img/arrow-down.png) right center no-repeat; + background: url(../treetable/img/arrow-down.png) right top no-repeat; } .v-ie6 .v-treetable-node-open { @@ -36,6 +36,10 @@ z-index: 10; } +.v-treetable .v-table-cell-wrapper { + position: relative; +} + .v-treetable .v-table-body .v-table-table .v-table-row-animating { zoom:1; z-index:1; diff --git a/WebContent/VAADIN/themes/reindeer/table/table.css b/WebContent/VAADIN/themes/reindeer/table/table.css index 2e6c597160..cab7d6a01f 100644 --- a/WebContent/VAADIN/themes/reindeer/table/table.css +++ b/WebContent/VAADIN/themes/reindeer/table/table.css @@ -130,9 +130,9 @@ text-shadow: #f3f5f8 0 1px 0; line-height: normal; } -.v-table-generated-row .v-table-cell-content { - padding-top: 1px; - padding-bottom: 2px; +.v-table-generated-row .v-table-cell-wrapper { + padding-top: 4px; + padding-bottom: 5px; } .v-table-cell-content:last-child { border-right-color: transparent; diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java index 324efcb67d..9899ec25e4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java @@ -173,7 +173,7 @@ public class VTreeTable extends VScrollTable { } class VTreeTableScrollBody extends VScrollTable.VScrollTableBody { - private int identWidth = -1; + private int indentWidth = -1; VTreeTableScrollBody() { super(); @@ -241,7 +241,7 @@ public class VTreeTable extends VScrollTable { container.insertFirst(treeSpacer); depth = rowUidl.hasAttribute("depth") ? rowUidl .getIntAttribute("depth") : 0; - setIdent(); + setIndent(); isTreeCellAdded = true; return true; } @@ -278,18 +278,19 @@ public class VTreeTable extends VScrollTable { } - private void setIdent() { - if (getIdentWidth() > 0 && depth != 0) { - treeSpacer.getStyle().setWidth( - (depth + 1) * getIdentWidth(), Unit.PX); + private void setIndent() { + if (getIndentWidth() > 0) { + treeSpacer.getParentElement().getStyle() + .setPaddingLeft(getIndent(), Unit.PX); + treeSpacer.getStyle().setWidth(getIndent(), Unit.PX); } } @Override protected void onAttach() { super.onAttach(); - if (getIdentWidth() < 0) { - detectIdent(this); + if (getIndentWidth() < 0) { + detectIndent(this); } } @@ -326,6 +327,19 @@ public class VTreeTable extends VScrollTable { return consumedSpace; } + @Override + protected void setCellWidth(int cellIx, int width) { + if (cellIx == colIndexOfHierarchy + (showRowHeaders ? 1 : 0)) { + // take indentation padding into account if this is the + // hierarchy column + width -= getIndent(); + } + super.setCellWidth(cellIx, width); + } + + private int getIndent() { + return (depth + 1) * getIndentWidth(); + } } protected class VTreeTableGeneratedRow extends VTreeTableRow { @@ -452,20 +466,20 @@ public class VTreeTable extends VScrollTable { } } - private int getIdentWidth() { - return identWidth; + private int getIndentWidth() { + return indentWidth; } - private void detectIdent(VTreeTableRow vTreeTableRow) { - identWidth = vTreeTableRow.treeSpacer.getOffsetWidth(); - if (identWidth == 0) { - identWidth = -1; + private void detectIndent(VTreeTableRow vTreeTableRow) { + indentWidth = vTreeTableRow.treeSpacer.getOffsetWidth(); + if (indentWidth == 0) { + indentWidth = -1; return; } Iterator iterator = iterator(); while (iterator.hasNext()) { VTreeTableRow next = (VTreeTableRow) iterator.next(); - next.setIdent(); + next.setIndent(); } } -- cgit v1.2.3 From 0676a3a814529deca31a40080982509c4238519c Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 9 Jul 2012 12:32:17 +0000 Subject: Revert #8193 patch because of regressions svn changeset:24000/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VView.java | 27 ++++------------------ src/com/vaadin/terminal/gwt/client/ui/VWindow.java | 3 --- 2 files changed, 5 insertions(+), 25 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VView.java b/src/com/vaadin/terminal/gwt/client/ui/VView.java index 3f0347c306..6fdacc9607 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VView.java @@ -18,8 +18,6 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.DomEvent.Type; -import com.google.gwt.event.dom.client.KeyDownEvent; -import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.event.logical.shared.ResizeEvent; import com.google.gwt.event.logical.shared.ResizeHandler; import com.google.gwt.event.shared.EventHandler; @@ -138,31 +136,12 @@ public class VView extends SimplePanel implements Container, ResizeHandler, // should not be in the document focus flow getElement().setTabIndex(-1); TouchScrollDelegate.enableTouchScrolling(this, getElement()); - - // Handle shortcut actions originated from the main window. Subwindow - // shortcut actions are handled by the subwindows themselves. - RootPanel.get().addDomHandler(new KeyDownHandler() { - public void onKeyDown(KeyDownEvent event) { - - Event nativeEvent = event.getNativeEvent().cast(); - com.google.gwt.user.client.Element target = nativeEvent - .getEventTarget().cast(); - // Ensure the event originates from our application even in case - // we're embedded. - if (actionHandler != null - && (!isEmbedded() || (Util.getPaintableForElement( - connection, getParent(), target) != null))) { - actionHandler.handleKeyboardEvent(nativeEvent); - } - } - }, KeyDownEvent.getType()); } /** * Start to periodically monitor for parent element resizes if embedded * application (e.g. portlet). */ - @Override protected void onLoad() { super.onLoad(); if (isMonitoringParentSize()) { @@ -590,7 +569,10 @@ public class VView extends SimplePanel implements Container, ResizeHandler, public void onBrowserEvent(Event event) { super.onBrowserEvent(event); int type = DOM.eventGetType(event); - if (scrollable && type == Event.ONSCROLL) { + if (type == Event.ONKEYDOWN && actionHandler != null) { + actionHandler.handleKeyboardEvent(event); + return; + } else if (scrollable && type == Event.ONSCROLL) { updateScrollPosition(); } } @@ -952,4 +934,5 @@ public class VView extends SimplePanel implements Container, ResizeHandler, public void focus() { getElement().focus(); } + } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java index 9b124ae466..2384ee7ddd 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VWindow.java @@ -1377,9 +1377,6 @@ public class VWindow extends VOverlay implements Container, if (shortcutHandler != null) { shortcutHandler .handleKeyboardEvent(Event.as(event.getNativeEvent())); - // Don't let the event propagate to the RootPanel where VView - // listens to shortcut events of the main window. - event.stopPropagation(); return; } } -- cgit v1.2.3 From ba2d51b6bd751eb9574bf245b56293f6dcdc2c06 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Mon, 9 Jul 2012 15:47:51 +0000 Subject: #7387 bugfix: ensure non-negative width svn changeset:24004/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java index 9899ec25e4..4b1448cdfb 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTreeTable.java @@ -332,7 +332,7 @@ public class VTreeTable extends VScrollTable { if (cellIx == colIndexOfHierarchy + (showRowHeaders ? 1 : 0)) { // take indentation padding into account if this is the // hierarchy column - width -= getIndent(); + width = Math.max(width - getIndent(), 0); } super.setCellWidth(cellIx, width); } -- cgit v1.2.3 From 2738dca83648db5323652b4ac4c53d46eb6001c0 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Wed, 11 Jul 2012 09:25:04 +0000 Subject: #8230 #8917 Fix input prompt leaking to the field value in TextField and TextArea svn changeset:24011/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/ui/VTextField.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java index d1e4f7ca5b..b05b9ba830 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VTextField.java @@ -433,7 +433,7 @@ public class VTextField extends TextBoxBase implements Paintable, Field, if (!prompting && newText != null && !newText.equals(valueBeforeEdit)) { sendValueChange = immediate; - client.updateVariable(id, "text", getText(), false); + client.updateVariable(id, "text", newText, false); valueBeforeEdit = newText; valueBeforeEditIsSynced = true; } @@ -500,6 +500,11 @@ public class VTextField extends TextBoxBase implements Paintable, Field, } public void onBlur(BlurEvent event) { + // this is called twice on Chrome when e.g. changing tab while prompting + // field focused - do not change settings on the second time + if (focusedTextField != this) { + return; + } removeStyleDependentName(CLASSNAME_FOCUS); focusedTextField = null; String text = getText(); -- cgit v1.2.3 From 25f664f993a1eb936cb516f1b748773b9b4d5239 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Wed, 18 Jul 2012 16:39:36 +0300 Subject: Initial commit for root cleanup support (#7893) --- src/com/vaadin/Application.java | 23 ++++++++++++++++++++++ .../terminal/gwt/client/ui/root/RootConnector.java | 16 +++++++++++++++ .../terminal/gwt/client/ui/root/RootServerRpc.java | 1 + src/com/vaadin/ui/Root.java | 16 +++++++++++++++ 4 files changed, 56 insertions(+) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/Application.java b/src/com/vaadin/Application.java index 468a7ee8be..79480f8dab 100644 --- a/src/com/vaadin/Application.java +++ b/src/com/vaadin/Application.java @@ -1066,6 +1066,7 @@ public class Application implements Terminal.ErrorListener, Serializable { * @see com.vaadin.terminal.Terminal.ErrorListener#terminalError(com.vaadin.terminal.Terminal.ErrorEvent) */ + @Override public void terminalError(Terminal.ErrorEvent event) { final Throwable t = event.getThrowable(); if (t instanceof SocketException) { @@ -1810,6 +1811,7 @@ public class Application implements Terminal.ErrorListener, Serializable { this.throwable = throwable; } + @Override public Throwable getThrowable() { return throwable; } @@ -2188,11 +2190,14 @@ public class Application implements Terminal.ErrorListener, Serializable { */ public Root getRootForRequest(WrappedRequest request) throws RootRequiresMoreInformationException { + System.out.println(" --- GET ROOT"); Root root = Root.getCurrent(); if (root != null) { + System.out.println(" ----- HAS CURRENT " + root.getRootId()); return root; } Integer rootId = getRootId(request); + System.out.println(" ----- ROOT ID FROM REQUEST " + rootId); synchronized (this) { BrowserDetails browserDetails = request.getBrowserDetails(); @@ -2202,6 +2207,7 @@ public class Application implements Terminal.ErrorListener, Serializable { root = roots.get(rootId); if (root == null && isRootPreserved()) { + System.out.println(" ----- ROOT NOT FOUND, CHECK IF PRESERVED"); // Check for a known root if (!retainOnRefreshRoots.isEmpty()) { @@ -2214,6 +2220,9 @@ public class Application implements Terminal.ErrorListener, Serializable { } if (retainedRootId != null) { + System.out.println(" ----- RETAINED ROOT ID " + + retainedRootId); + rootId = retainedRootId; root = roots.get(rootId); } @@ -2221,9 +2230,13 @@ public class Application implements Terminal.ErrorListener, Serializable { } if (root == null) { + System.out.println(" ----- ROOT STILL NULL"); + // Throws exception if root can not yet be created root = getRoot(request); + System.out.println(" ----- GET ROOT " + root.getRootId()); + // Initialize some fields for a newly created root if (root.getApplication() == null) { root.setApplication(this); @@ -2236,6 +2249,7 @@ public class Application implements Terminal.ErrorListener, Serializable { } root.setRootId(rootId.intValue()); roots.put(rootId, root); + System.out.println(" ----- CREATED ROOT " + rootId); } } @@ -2243,6 +2257,8 @@ public class Application implements Terminal.ErrorListener, Serializable { Root.setCurrent(root); if (!initedRoots.contains(rootId)) { + System.out.println(" ----- INIT ROOT " + rootId); + boolean initRequiresBrowserDetails = isRootPreserved() || !root.getClass() .isAnnotationPresent(EagerInit.class); @@ -2263,6 +2279,7 @@ public class Application implements Terminal.ErrorListener, Serializable { } } // end synchronized block + System.out.println(" ----- USING ROOT " + root.getRootId()); return root; } @@ -2387,4 +2404,10 @@ public class Application implements Terminal.ErrorListener, Serializable { public Root getRootById(int rootId) { return roots.get(rootId); } + + public void removeRoot(int rootId) { + System.out.println(" --- REMOVE ROOT ID " + rootId); + System.out.println(" ----- EXISTS? " + roots.containsKey(rootId)); + roots.remove(rootId); + } } diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java index 2371fb1140..0ab27e92c1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/RootConnector.java @@ -11,6 +11,8 @@ import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Position; +import com.google.gwt.event.logical.shared.CloseEvent; +import com.google.gwt.event.logical.shared.CloseHandler; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; @@ -51,6 +53,7 @@ public class RootConnector extends AbstractComponentContainerConnector private HandlerRegistration childStateChangeHandlerRegistration; private final StateChangeHandler childStateChangeHandler = new StateChangeHandler() { + @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { // TODO Should use a more specific handler that only reacts to // size changes @@ -62,12 +65,14 @@ public class RootConnector extends AbstractComponentContainerConnector protected void init() { super.init(); registerRpc(PageClientRpc.class, new PageClientRpc() { + @Override public void setTitle(String title) { com.google.gwt.user.client.Window.setTitle(title); } }); } + @Override public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) { ConnectorMap paintableMap = ConnectorMap.get(getConnection()); getWidget().rendering = true; @@ -118,6 +123,7 @@ public class RootConnector extends AbstractComponentContainerConnector // to finish rendering this window in case this is a download // (and window stays open). Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { VRoot.goTo(url); } @@ -182,6 +188,7 @@ public class RootConnector extends AbstractComponentContainerConnector if (uidl.hasAttribute("focused")) { // set focused component when render phase is finished Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { ComponentConnector paintable = (ComponentConnector) uidl .getPaintableAttribute("focused", getConnection()); @@ -274,6 +281,13 @@ public class RootConnector extends AbstractComponentContainerConnector root.add(getWidget()); + Window.addCloseHandler(new CloseHandler() { + @Override + public void onClose(CloseEvent event) { + rpc.close(); + } + }); + if (applicationConnection.getConfiguration().isStandalone()) { // set focus to iview element by default to listen possible keyboard // shortcuts. For embedded applications this is unacceptable as we @@ -293,6 +307,7 @@ public class RootConnector extends AbstractComponentContainerConnector }; + @Override public void updateCaption(ComponentConnector component) { // NOP The main view never draws caption for its layout } @@ -412,6 +427,7 @@ public class RootConnector extends AbstractComponentContainerConnector } Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { componentConnector.getWidget().getElement().scrollIntoView(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java b/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java index 389500949d..066645d130 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/RootServerRpc.java @@ -8,4 +8,5 @@ import com.vaadin.terminal.gwt.client.ui.ClickRpc; public interface RootServerRpc extends ClickRpc, ServerRpc { + public void close(); } \ No newline at end of file diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java index 9271097a46..23f491949f 100644 --- a/src/com/vaadin/ui/Root.java +++ b/src/com/vaadin/ui/Root.java @@ -419,9 +419,16 @@ public abstract class Root extends AbstractComponentContainer implements private Page page = new Page(this); private RootServerRpc rpc = new RootServerRpc() { + @Override public void click(MouseEventDetails mouseDetails) { fireEvent(new ClickEvent(Root.this, mouseDetails)); } + + @Override + public void close() { + System.out.println(" --- ROOT CLOSE RPC " + rootId); + getApplication().removeRoot(rootId); + } }; /** @@ -502,6 +509,7 @@ public abstract class Root extends AbstractComponentContainer implements return this; } + @Override public void replaceComponent(Component oldComponent, Component newComponent) { throw new UnsupportedOperationException(); } @@ -511,6 +519,7 @@ public abstract class Root extends AbstractComponentContainer implements return application; } + @Override public void paintContent(PaintTarget target) throws PaintException { page.paintContent(target); @@ -550,6 +559,7 @@ public abstract class Root extends AbstractComponentContainer implements fireEvent(new ClickEvent(this, mouseDetails)); } + @Override @SuppressWarnings("unchecked") public void changeVariables(Object source, Map variables) { if (variables.containsKey(CLICK_EVENT_ID)) { @@ -578,6 +588,7 @@ public abstract class Root extends AbstractComponentContainer implements * * @see com.vaadin.ui.ComponentContainer#getComponentIterator() */ + @Override public Iterator getComponentIterator() { // TODO could directly create some kind of combined iterator instead of // creating a new ArrayList @@ -597,6 +608,7 @@ public abstract class Root extends AbstractComponentContainer implements * * @see com.vaadin.ui.ComponentContainer#getComponentCount() */ + @Override public int getComponentCount() { return windows.size() + (getContent() == null ? 0 : 1); } @@ -956,11 +968,13 @@ public abstract class Root extends AbstractComponentContainer implements return actionManager; } + @Override public void addAction( T action) { getActionManager().addAction(action); } + @Override public void removeAction( T action) { if (actionManager != null) { @@ -968,10 +982,12 @@ public abstract class Root extends AbstractComponentContainer implements } } + @Override public void addActionHandler(Handler actionHandler) { getActionManager().addActionHandler(actionHandler); } + @Override public void removeActionHandler(Handler actionHandler) { if (actionManager != null) { actionManager.removeActionHandler(actionHandler); -- cgit v1.2.3 From e814541d8cf5647ab47cc9f8495c84f5ddef2aa1 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Wed, 18 Jul 2012 18:41:14 +0300 Subject: Initial support for showing state changes in the debug console (#8422) --- .../terminal/gwt/client/ApplicationConnection.java | 12 +++++++++++- src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java | 20 ++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java index 52b83a6e67..5db7221bdb 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConnection.java @@ -136,7 +136,7 @@ public class ApplicationConnection { */ public static final String UIDL_REFRESH_TOKEN = "Vaadin-Refresh"; - private final boolean debugLogging = false; + private final boolean debugLogging = true || false; // will hold the UIDL security key (for XSS protection) once received private String uidlSecurityKey = "init"; @@ -543,11 +543,13 @@ public class ApplicationConnection { final boolean synchronous) { if (!synchronous) { RequestCallback requestCallback = new RequestCallback() { + @Override public void onError(Request request, Throwable exception) { showCommunicationError(exception.getMessage(), -1); endRequest(); } + @Override public void onResponseReceived(Request request, Response response) { VConsole.log("Server visit took " @@ -873,6 +875,7 @@ public class ApplicationConnection { } // deferring to avoid flickering Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { if (!hasActiveRequest()) { hideLoadingIndicator(); @@ -1090,6 +1093,7 @@ public class ApplicationConnection { } Command c = new Command() { + @Override public void execute() { handleUIDLDuration.logDuration(" * Loading widgets completed", 10); @@ -1627,10 +1631,12 @@ public class ApplicationConnection { private void loadStyleDependencies(JsArrayString dependencies) { // Assuming no reason to interpret in a defined order ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { + @Override public void onLoad(ResourceLoadEvent event) { ApplicationConfiguration.endDependencyLoading(); } + @Override public void onError(ResourceLoadEvent event) { VConsole.error(event.getResourceUrl() + " could not be loaded, or the load detection failed because the stylesheet is empty."); @@ -1653,6 +1659,7 @@ public class ApplicationConnection { // Listener that loads the next when one is completed ResourceLoadListener resourceLoadListener = new ResourceLoadListener() { + @Override public void onLoad(ResourceLoadEvent event) { if (dependencies.length() != 0) { String url = translateVaadinUri(dependencies.shift()); @@ -1664,6 +1671,7 @@ public class ApplicationConnection { ApplicationConfiguration.endDependencyLoading(); } + @Override public void onError(ResourceLoadEvent event) { VConsole.error(event.getResourceUrl() + " could not be loaded."); // The show must go on @@ -1743,6 +1751,7 @@ public class ApplicationConnection { } private final ScheduledCommand sendPendingCommand = new ScheduledCommand() { + @Override public void execute() { deferedSendPending = false; doSendPendingVariableChanges(); @@ -2322,6 +2331,7 @@ public class ApplicationConnection { this.url = url; } + @Override public void notificationHidden(HideEvent event) { redirect(url); } diff --git a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java index 4230eda298..5aceb15bfa 100644 --- a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java +++ b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java @@ -22,6 +22,7 @@ import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.MouseOutEvent; import com.google.gwt.event.dom.client.MouseOutHandler; +import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector; @@ -47,9 +48,22 @@ public class VUIDLBrowser extends SimpleTree { Set keySet = u.getKeySet(); for (String key : keySet) { if (key.equals("state")) { - // TODO print updated shared states + + ValueMap stateJson = u.getValueMap(key); + + for (String stateKey : stateJson.getKeySet()) { + ValueMap valuesJson = stateJson.getValueMap(stateKey); + + SimpleTree values = new SimpleTree("state pid=" + stateKey); + for (String valueKey : valuesJson.getKeySet()) { + values.add(new HTML(valueKey + "=" + + valuesJson.getAsString(valueKey))); + } + add(values); + } + } else if (key.equals("changes")) { - JsArray jsValueMapArray = u.getJSValueMapArray("changes") + JsArray jsValueMapArray = u.getJSValueMapArray(key) .cast(); for (int i = 0; i < jsValueMapArray.length(); i++) { UIDL uidl = jsValueMapArray.get(i); @@ -89,6 +103,7 @@ public class VUIDLBrowser extends SimpleTree { } addDomHandler(new MouseOutHandler() { + @Override public void onMouseOut(MouseOutEvent event) { deHiglight(); } @@ -218,6 +233,7 @@ public class VUIDLBrowser extends SimpleTree { if (highlightedPid != null && highlightedPid.equals(uidl.getId())) { getElement().getStyle().setBackgroundColor("#fdd"); Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { getElement().scrollIntoView(); } -- cgit v1.2.3 From 98c4fdfddca55146c1c0ffd03317e06f19052041 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 20 Jul 2012 17:48:59 +0300 Subject: Refactored shared state printing to its own SimpleTree subclass: now recursively prints arrays and objects in the JSON. --- .../vaadin/terminal/gwt/client/VUIDLBrowser.java | 152 ++++++++++++++++----- 1 file changed, 115 insertions(+), 37 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java index 5aceb15bfa..8131477d1c 100644 --- a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java +++ b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java @@ -22,17 +22,27 @@ import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.MouseOutEvent; import com.google.gwt.event.dom.client.MouseOutHandler; +import com.google.gwt.json.client.JSONArray; +import com.google.gwt.json.client.JSONObject; +import com.google.gwt.json.client.JSONValue; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ui.UnknownComponentConnector; import com.vaadin.terminal.gwt.client.ui.window.VWindow; +/** + * TODO Rename to something more Vaadin7-ish? + */ public class VUIDLBrowser extends SimpleTree { private static final String HELP = "Shift click handle to open recursively. Click components to hightlight them on client side. Shift click components to highlight them also on the server side."; private ApplicationConfiguration conf; private String highlightedPid; + /** + * TODO Should probably take ApplicationConnection instead of + * ApplicationConfiguration + */ public VUIDLBrowser(final UIDL uidl, ApplicationConfiguration conf) { this.conf = conf; final UIDLItem root = new UIDLItem(uidl, conf); @@ -50,17 +60,13 @@ public class VUIDLBrowser extends SimpleTree { if (key.equals("state")) { ValueMap stateJson = u.getValueMap(key); + SimpleTree stateChanges = new SimpleTree("Shared state"); for (String stateKey : stateJson.getKeySet()) { - ValueMap valuesJson = stateJson.getValueMap(stateKey); - - SimpleTree values = new SimpleTree("state pid=" + stateKey); - for (String valueKey : valuesJson.getKeySet()) { - values.add(new HTML(valueKey + "=" - + valuesJson.getAsString(valueKey))); - } - add(values); + stateChanges.add(new SharedStateItem(stateKey, stateJson + .getValueMap(stateKey))); } + add(stateChanges); } else if (key.equals("changes")) { JsArray jsValueMapArray = u.getJSValueMapArray(key) @@ -82,12 +88,107 @@ public class VUIDLBrowser extends SimpleTree { setTitle(HELP); } - class UIDLItem extends SimpleTree { + /** + * A debug view of a server-originated component state change. + */ + abstract class StateChangeItem extends SimpleTree { + + protected StateChangeItem() { + setTitle(HELP); + + addDomHandler(new MouseOutHandler() { + @Override + public void onMouseOut(MouseOutEvent event) { + deHiglight(); + } + }, MouseOutEvent.getType()); + } + + @Override + protected void select(ClickEvent event) { + ComponentConnector connector = getConnector(); + highlight(connector); + if (event != null && event.getNativeEvent().getShiftKey()) { + connector.getConnection().highlightComponent(connector); + } + super.select(event); + } + + /** + * Returns the Connector associated with this state change. + */ + protected ComponentConnector getConnector() { + List runningApplications = ApplicationConfiguration + .getRunningApplications(); + + // TODO this does not work properly with multiple application on + // same host page + for (ApplicationConnection applicationConnection : runningApplications) { + ServerConnector connector = ConnectorMap.get( + applicationConnection).getConnector(getConnectorId()); + if (connector instanceof ComponentConnector) { + return (ComponentConnector) connector; + } + } + return new UnknownComponentConnector(); + } + + protected abstract String getConnectorId(); + } + + /** + * A debug view of a Vaadin 7 style shared state change. + */ + class SharedStateItem extends StateChangeItem { + + private String connectorId; + + SharedStateItem(String connectorId, ValueMap stateChanges) { + this.connectorId = connectorId; + setText(connectorId); + dir(new JSONObject(stateChanges), this); + } + + @Override + protected String getConnectorId() { + return connectorId; + } + + private void dir(String key, JSONValue value, SimpleTree tree) { + if (value.isObject() != null) { + SimpleTree subtree = new SimpleTree(key + "=object"); + tree.add(subtree); + dir(value.isObject(), subtree); + } else if (value.isArray() != null) { + SimpleTree subtree = new SimpleTree(key + "=array"); + dir(value.isArray(), subtree); + tree.add(subtree); + } else { + tree.add(new HTML(key + "=" + value)); + } + } + + private void dir(JSONObject state, SimpleTree tree) { + for (String key : state.keySet()) { + dir(key, state.get(key), tree); + } + } + + private void dir(JSONArray array, SimpleTree tree) { + for (int i = 0; i < array.size(); ++i) { + dir("" + i, array.get(i), tree); + } + } + } + + /** + * A debug view of a Vaadin 6 style hierarchical component state change. + */ + class UIDLItem extends StateChangeItem { private UIDL uidl; UIDLItem(UIDL uidl, ApplicationConfiguration conf) { - setTitle(HELP); this.uidl = uidl; try { String name = uidl.getTag(); @@ -101,14 +202,11 @@ public class VUIDLBrowser extends SimpleTree { } catch (Exception e) { setText(uidl.toString()); } + } - addDomHandler(new MouseOutHandler() { - @Override - public void onMouseOut(MouseOutEvent event) { - deHiglight(); - } - }, MouseOutEvent.getType()); - + @Override + protected String getConnectorId() { + return uidl.getId(); } private String getNodeName(UIDL uidl, ApplicationConfiguration conf, @@ -133,26 +231,6 @@ public class VUIDLBrowser extends SimpleTree { super.open(recursive); } - @Override - protected void select(ClickEvent event) { - List runningApplications = ApplicationConfiguration - .getRunningApplications(); - - // TODO this does not work properly with multiple application on - // same - // host page - for (ApplicationConnection applicationConnection : runningApplications) { - ComponentConnector paintable = (ComponentConnector) ConnectorMap - .get(applicationConnection).getConnector(uidl.getId()); - highlight(paintable); - if (event != null && event.getNativeEvent().getShiftKey()) { - applicationConnection.highlightComponent(paintable); - } - } - - super.select(event); - } - public void dir() { remove(0); -- cgit v1.2.3 From b6ea64e917b69a80bd61c0541947fee8faf0e46c Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Fri, 20 Jul 2012 15:02:36 +0000 Subject: Fix a typo svn changeset:24019/svn branch:6.8 --- src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java index 95d2fd0b5f..90912b4449 100644 --- a/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java +++ b/src/com/vaadin/terminal/gwt/client/VUIDLBrowser.java @@ -29,7 +29,7 @@ import com.vaadin.terminal.gwt.client.ui.VView; import com.vaadin.terminal.gwt.client.ui.VWindow; public class VUIDLBrowser extends SimpleTree { - private static final String HELP = "Shift click handle to open recursively. Click components to hightlight them on client side. Shift click components to highlight them also on the server side."; + private static final String HELP = "Shift click handle to open recursively. Click components to highlight them on client side. Shift click components to highlight them also on the server side."; private ApplicationConfiguration conf; private String highlightedPid; @@ -201,7 +201,7 @@ public class VUIDLBrowser extends SimpleTree { tmp.addItem(name + "=" + value); } if (tmp != null) { - add(tmp); + add(tmp); } } catch (final Exception e) { // Ignored, no variables -- cgit v1.2.3 From 3604bf01ded16d21041cbb655632429e00c94639 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Mon, 23 Jul 2012 15:23:43 +0300 Subject: Add Java 6 @Override annotations to all methods from interfaces --- src/com/vaadin/data/Container.java | 1 + .../fieldgroup/DefaultFieldGroupFieldFactory.java | 1 + .../vaadin/data/util/AbstractBeanContainer.java | 12 +++++++ src/com/vaadin/data/util/AbstractContainer.java | 2 ++ .../data/util/AbstractInMemoryContainer.java | 22 +++++++++++++ src/com/vaadin/data/util/AbstractProperty.java | 8 +++++ src/com/vaadin/data/util/BeanItemContainer.java | 1 + .../data/util/ContainerHierarchicalWrapper.java | 28 ++++++++++++++++ .../vaadin/data/util/ContainerOrderedWrapper.java | 27 ++++++++++++++++ src/com/vaadin/data/util/DefaultItemSorter.java | 3 ++ src/com/vaadin/data/util/FilesystemContainer.java | 26 +++++++++++++++ .../vaadin/data/util/HierarchicalContainer.java | 8 +++++ .../util/HierarchicalContainerOrderedWrapper.java | 8 +++++ src/com/vaadin/data/util/IndexedContainer.java | 24 ++++++++++++++ src/com/vaadin/data/util/ItemSorter.java | 1 + src/com/vaadin/data/util/MethodProperty.java | 3 ++ .../vaadin/data/util/MethodPropertyDescriptor.java | 3 ++ src/com/vaadin/data/util/NestedMethodProperty.java | 3 ++ .../vaadin/data/util/NestedPropertyDescriptor.java | 3 ++ src/com/vaadin/data/util/ObjectProperty.java | 3 ++ src/com/vaadin/data/util/PropertyFormatter.java | 7 ++++ src/com/vaadin/data/util/PropertysetItem.java | 7 ++++ src/com/vaadin/data/util/QueryContainer.java | 29 +++++++++++++++++ src/com/vaadin/data/util/TextFileProperty.java | 3 ++ .../data/util/TransactionalPropertyWrapper.java | 7 ++++ .../data/util/converter/DateToLongConverter.java | 4 +++ .../util/converter/DefaultConverterFactory.java | 1 + .../data/util/converter/ReverseConverter.java | 4 +++ .../util/converter/StringToBooleanConverter.java | 4 +++ .../data/util/converter/StringToDateConverter.java | 4 +++ .../util/converter/StringToDoubleConverter.java | 4 +++ .../util/converter/StringToIntegerConverter.java | 4 +++ .../util/converter/StringToNumberConverter.java | 4 +++ .../data/util/filter/AbstractJunctionFilter.java | 1 + src/com/vaadin/data/util/filter/And.java | 1 + src/com/vaadin/data/util/filter/Between.java | 2 ++ src/com/vaadin/data/util/filter/Compare.java | 2 ++ src/com/vaadin/data/util/filter/IsNull.java | 2 ++ src/com/vaadin/data/util/filter/Like.java | 2 ++ src/com/vaadin/data/util/filter/Not.java | 2 ++ src/com/vaadin/data/util/filter/Or.java | 1 + .../data/util/filter/SimpleStringFilter.java | 2 ++ .../data/util/sqlcontainer/ColumnProperty.java | 5 +++ src/com/vaadin/data/util/sqlcontainer/RowItem.java | 4 +++ .../data/util/sqlcontainer/SQLContainer.java | 33 +++++++++++++++++++ .../connection/J2EEConnectionPool.java | 3 ++ .../connection/SimpleJDBCConnectionPool.java | 3 ++ .../util/sqlcontainer/query/FreeformQuery.java | 12 +++++++ .../data/util/sqlcontainer/query/TableQuery.java | 16 ++++++++++ .../query/generator/DefaultSQLGenerator.java | 4 +++ .../query/generator/filter/AndTranslator.java | 2 ++ .../query/generator/filter/BetweenTranslator.java | 2 ++ .../query/generator/filter/CompareTranslator.java | 2 ++ .../query/generator/filter/IsNullTranslator.java | 2 ++ .../query/generator/filter/LikeTranslator.java | 2 ++ .../query/generator/filter/NotTranslator.java | 2 ++ .../query/generator/filter/OrTranslator.java | 2 ++ .../generator/filter/SimpleStringTranslator.java | 2 ++ .../vaadin/data/validator/AbstractValidator.java | 1 + src/com/vaadin/data/validator/BeanValidator.java | 3 ++ .../vaadin/data/validator/CompositeValidator.java | 1 + src/com/vaadin/data/validator/NullValidator.java | 1 + src/com/vaadin/event/ActionManager.java | 6 ++++ src/com/vaadin/event/EventRouter.java | 5 +++ src/com/vaadin/event/FieldEvents.java | 2 ++ src/com/vaadin/event/ShortcutListener.java | 1 + src/com/vaadin/event/TransferableImpl.java | 4 +++ src/com/vaadin/event/dd/TargetDetailsImpl.java | 2 ++ .../vaadin/event/dd/acceptcriteria/AcceptAll.java | 1 + src/com/vaadin/event/dd/acceptcriteria/And.java | 1 + .../dd/acceptcriteria/ClientSideCriterion.java | 3 ++ .../dd/acceptcriteria/ContainsDataFlavor.java | 1 + src/com/vaadin/event/dd/acceptcriteria/Not.java | 1 + src/com/vaadin/event/dd/acceptcriteria/Or.java | 1 + .../dd/acceptcriteria/ServerSideCriterion.java | 3 ++ .../vaadin/event/dd/acceptcriteria/SourceIs.java | 1 + .../event/dd/acceptcriteria/SourceIsTarget.java | 1 + .../event/dd/acceptcriteria/TargetDetailIs.java | 1 + src/com/vaadin/external/json/JSONException.java | 1 + src/com/vaadin/external/json/JSONStringer.java | 1 + src/com/vaadin/navigator/Navigator.java | 10 ++++++ .../vaadin/terminal/AbstractClientConnector.java | 20 ++++++++++++ src/com/vaadin/terminal/AbstractErrorMessage.java | 2 ++ src/com/vaadin/terminal/ClassResource.java | 6 ++++ src/com/vaadin/terminal/CombinedRequest.java | 20 ++++++++++++ src/com/vaadin/terminal/ExternalResource.java | 1 + src/com/vaadin/terminal/FileResource.java | 7 ++++ .../vaadin/terminal/JavaScriptCallbackHelper.java | 1 + src/com/vaadin/terminal/StreamResource.java | 6 ++++ src/com/vaadin/terminal/ThemeResource.java | 1 + .../terminal/gwt/client/AbstractFieldState.java | 2 ++ .../gwt/client/ApplicationConfiguration.java | 3 ++ .../terminal/gwt/client/ComponentConnector.java | 1 + .../gwt/client/JavaScriptConnectorHelper.java | 1 + .../terminal/gwt/client/JavaScriptExtension.java | 1 + .../gwt/client/JavaScriptExtensionState.java | 2 ++ .../vaadin/terminal/gwt/client/NullConsole.java | 9 ++++++ .../vaadin/terminal/gwt/client/ResourceLoader.java | 11 +++++++ .../terminal/gwt/client/ServerConnector.java | 1 + src/com/vaadin/terminal/gwt/client/SimpleTree.java | 1 + .../vaadin/terminal/gwt/client/SuperDevMode.java | 3 ++ src/com/vaadin/terminal/gwt/client/UIDL.java | 3 ++ src/com/vaadin/terminal/gwt/client/Util.java | 2 ++ .../vaadin/terminal/gwt/client/VDebugConsole.java | 26 +++++++++++++++ .../vaadin/terminal/gwt/client/VSchedulerImpl.java | 1 + src/com/vaadin/terminal/gwt/client/VTooltip.java | 4 +++ .../vaadin/terminal/gwt/client/WidgetLoader.java | 2 ++ .../communication/URLReference_Serializer.java | 2 ++ .../JavaScriptManagerConnector.java | 1 + .../gwt/client/ui/AbstractClickEventHandler.java | 5 +++ .../gwt/client/ui/AbstractComponentConnector.java | 11 +++++++ .../ui/AbstractComponentContainerConnector.java | 4 +++ .../terminal/gwt/client/ui/AbstractConnector.java | 15 +++++++++ src/com/vaadin/terminal/gwt/client/ui/Action.java | 1 + .../gwt/client/ui/ConnectorWidgetFactory.java | 1 + .../terminal/gwt/client/ui/FocusableFlexTable.java | 5 +++ .../terminal/gwt/client/ui/FocusableFlowPanel.java | 5 +++ .../gwt/client/ui/FocusableScrollPanel.java | 3 ++ .../client/ui/JavaScriptComponentConnector.java | 1 + .../gwt/client/ui/JavaScriptComponentState.java | 2 ++ .../terminal/gwt/client/ui/MediaBaseConnector.java | 2 ++ .../gwt/client/ui/ShortcutActionHandler.java | 3 ++ .../gwt/client/ui/SimpleFocusablePanel.java | 5 +++ .../gwt/client/ui/TouchScrollDelegate.java | 2 ++ .../vaadin/terminal/gwt/client/ui/TreeImages.java | 2 ++ .../terminal/gwt/client/ui/VContextMenu.java | 10 ++++++ .../vaadin/terminal/gwt/client/ui/VOverlay.java | 1 + .../terminal/gwt/client/ui/Vaadin6Connector.java | 1 + .../ui/absolutelayout/AbsoluteLayoutConnector.java | 3 ++ .../client/ui/accordion/AccordionConnector.java | 2 ++ .../gwt/client/ui/accordion/VAccordion.java | 1 + .../gwt/client/ui/button/ButtonConnector.java | 3 ++ .../terminal/gwt/client/ui/button/ButtonState.java | 2 ++ .../terminal/gwt/client/ui/button/VButton.java | 1 + .../gwt/client/ui/checkbox/CheckBoxConnector.java | 3 ++ .../gwt/client/ui/combobox/ComboBoxConnector.java | 2 ++ .../gwt/client/ui/combobox/VFilterSelect.java | 17 ++++++++++ .../client/ui/csslayout/CssLayoutConnector.java | 1 + .../customcomponent/CustomComponentConnector.java | 1 + .../ui/customlayout/CustomLayoutConnector.java | 2 ++ .../ui/datefield/AbstractDateFieldConnector.java | 1 + .../ui/datefield/InlineDateFieldConnector.java | 2 ++ .../ui/datefield/PopupDateFieldConnector.java | 2 ++ .../gwt/client/ui/datefield/VCalendarPanel.java | 12 +++++++ .../client/ui/datefield/VDateFieldCalendar.java | 3 ++ .../gwt/client/ui/datefield/VPopupCalendar.java | 6 ++++ .../gwt/client/ui/datefield/VTextualDate.java | 6 ++++ .../gwt/client/ui/dd/VAbstractDropHandler.java | 8 +++++ .../gwt/client/ui/dd/VAcceptCriterion.java | 1 + src/com/vaadin/terminal/gwt/client/ui/dd/VAnd.java | 1 + .../gwt/client/ui/dd/VDragAndDropManager.java | 4 +++ .../gwt/client/ui/dd/VLazyInitItemIdentifiers.java | 1 + src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java | 1 + src/com/vaadin/terminal/gwt/client/ui/dd/VOr.java | 1 + .../terminal/gwt/client/ui/dd/VServerAccept.java | 1 + .../DragAndDropWrapperConnector.java | 1 + .../ui/draganddropwrapper/VDragAndDropWrapper.java | 7 ++++ .../gwt/client/ui/embedded/EmbeddedConnector.java | 1 + .../terminal/gwt/client/ui/form/FormConnector.java | 3 ++ .../vaadin/terminal/gwt/client/ui/form/VForm.java | 1 + .../client/ui/formlayout/FormLayoutConnector.java | 1 + .../gwt/client/ui/formlayout/VFormLayout.java | 1 + .../client/ui/gridlayout/GridLayoutConnector.java | 4 +++ .../terminal/gwt/client/ui/link/LinkConnector.java | 1 + .../vaadin/terminal/gwt/client/ui/link/VLink.java | 1 + .../gwt/client/ui/listselect/VListSelect.java | 1 + .../terminal/gwt/client/ui/menubar/MenuBar.java | 1 + .../gwt/client/ui/menubar/MenuBarConnector.java | 3 ++ .../terminal/gwt/client/ui/menubar/MenuItem.java | 4 +++ .../terminal/gwt/client/ui/menubar/VMenuBar.java | 11 +++++++ .../ui/nativebutton/NativeButtonConnector.java | 2 ++ .../gwt/client/ui/nativebutton/VNativeButton.java | 1 + .../gwt/client/ui/nativeselect/VNativeSelect.java | 1 + .../ui/optiongroup/OptionGroupBaseConnector.java | 1 + .../gwt/client/ui/optiongroup/VOptionGroup.java | 5 +++ .../client/ui/optiongroup/VOptionGroupBase.java | 3 ++ .../AbstractOrderedLayoutConnector.java | 3 ++ .../gwt/client/ui/panel/PanelConnector.java | 4 +++ .../terminal/gwt/client/ui/panel/VPanel.java | 2 ++ .../client/ui/popupview/PopupViewConnector.java | 3 ++ .../gwt/client/ui/popupview/VPopupView.java | 2 ++ .../ProgressIndicatorConnector.java | 1 + .../ui/richtextarea/RichTextAreaConnector.java | 2 ++ .../gwt/client/ui/richtextarea/VRichTextArea.java | 10 ++++++ .../client/ui/richtextarea/VRichTextToolbar.java | 3 ++ .../vaadin/terminal/gwt/client/ui/root/VRoot.java | 6 ++++ .../gwt/client/ui/slider/SliderConnector.java | 2 ++ .../terminal/gwt/client/ui/slider/VSlider.java | 3 ++ .../ui/splitpanel/AbstractSplitPanelConnector.java | 3 ++ .../client/ui/splitpanel/VAbstractSplitPanel.java | 4 +++ .../gwt/client/ui/table/TableConnector.java | 7 ++++ .../terminal/gwt/client/ui/table/VScrollTable.java | 37 ++++++++++++++++++++++ .../client/ui/tabsheet/TabsheetBaseConnector.java | 1 + .../gwt/client/ui/tabsheet/TabsheetConnector.java | 2 ++ .../terminal/gwt/client/ui/tabsheet/VTabsheet.java | 10 ++++++ .../terminal/gwt/client/ui/textarea/VTextArea.java | 1 + .../client/ui/textfield/TextFieldConnector.java | 3 ++ .../gwt/client/ui/textfield/VTextField.java | 4 +++ .../terminal/gwt/client/ui/tree/TreeConnector.java | 1 + .../vaadin/terminal/gwt/client/ui/tree/VTree.java | 21 ++++++++++++ .../gwt/client/ui/treetable/VTreeTable.java | 1 + .../ui/twincolselect/TwinColSelectConnector.java | 2 ++ .../client/ui/twincolselect/VTwinColSelect.java | 6 ++++ .../gwt/client/ui/upload/UploadConnector.java | 1 + .../terminal/gwt/client/ui/upload/VUpload.java | 2 ++ .../terminal/gwt/client/ui/window/VWindow.java | 9 ++++++ .../gwt/client/ui/window/WindowConnector.java | 5 +++ .../gwt/server/AbstractApplicationPortlet.java | 8 +++++ .../gwt/server/AbstractApplicationServlet.java | 8 +++++ .../gwt/server/AbstractCommunicationManager.java | 6 ++++ .../gwt/server/AbstractStreamingEvent.java | 4 +++ .../gwt/server/AbstractWebApplicationContext.java | 8 +++++ .../gwt/server/ApplicationResourceHandler.java | 1 + .../terminal/gwt/server/BootstrapHandler.java | 1 + .../gwt/server/ChangeVariablesErrorEvent.java | 1 + .../terminal/gwt/server/ClientConnector.java | 1 + .../gwt/server/ClientMethodInvocation.java | 1 + .../terminal/gwt/server/DragAndDropService.java | 18 +++++++++++ .../terminal/gwt/server/JsonPaintTarget.java | 31 ++++++++++++++++++ .../gwt/server/PortletApplicationContext2.java | 1 + .../gwt/server/RestrictedRenderResponse.java | 25 +++++++++++++++ .../terminal/gwt/server/ServerRpcManager.java | 1 + .../gwt/server/StreamingErrorEventImpl.java | 1 + .../gwt/server/StreamingStartEventImpl.java | 1 + .../gwt/server/UnsupportedBrowserHandler.java | 1 + .../terminal/gwt/server/WebApplicationContext.java | 1 + src/com/vaadin/terminal/gwt/server/WebBrowser.java | 3 ++ .../gwt/server/WrappedHttpServletRequest.java | 9 ++++++ .../gwt/server/WrappedHttpServletResponse.java | 2 ++ .../terminal/gwt/server/WrappedPortletRequest.java | 20 ++++++++++++ .../gwt/server/WrappedPortletResponse.java | 9 ++++++ .../gwt/widgetsetutils/ClassPathExplorer.java | 1 + src/com/vaadin/tools/WidgetsetCompiler.java | 1 + src/com/vaadin/ui/AbsoluteLayout.java | 6 ++++ src/com/vaadin/ui/AbstractComponent.java | 35 ++++++++++++++++++++ src/com/vaadin/ui/AbstractComponentContainer.java | 10 ++++++ src/com/vaadin/ui/AbstractField.java | 36 +++++++++++++++++++++ src/com/vaadin/ui/AbstractLayout.java | 4 +++ src/com/vaadin/ui/AbstractOrderedLayout.java | 11 +++++++ src/com/vaadin/ui/AbstractSelect.java | 30 ++++++++++++++++++ src/com/vaadin/ui/AbstractSplitPanel.java | 8 +++++ src/com/vaadin/ui/AbstractTextField.java | 8 +++++ src/com/vaadin/ui/Button.java | 8 +++++ src/com/vaadin/ui/CheckBox.java | 1 + src/com/vaadin/ui/Component.java | 4 +++ src/com/vaadin/ui/CssLayout.java | 6 ++++ src/com/vaadin/ui/CustomComponent.java | 6 ++++ src/com/vaadin/ui/CustomField.java | 16 ++++++++++ src/com/vaadin/ui/CustomLayout.java | 5 +++ src/com/vaadin/ui/DateField.java | 6 ++++ src/com/vaadin/ui/DefaultFieldFactory.java | 2 ++ src/com/vaadin/ui/DragAndDropWrapper.java | 18 +++++++++++ src/com/vaadin/ui/Embedded.java | 3 ++ src/com/vaadin/ui/Field.java | 1 + src/com/vaadin/ui/Form.java | 19 +++++++++++ src/com/vaadin/ui/GridLayout.java | 13 ++++++++ src/com/vaadin/ui/JavaScript.java | 1 + src/com/vaadin/ui/Label.java | 10 ++++++ src/com/vaadin/ui/Link.java | 2 ++ src/com/vaadin/ui/LoginForm.java | 7 ++++ src/com/vaadin/ui/MenuBar.java | 2 ++ src/com/vaadin/ui/OptionGroup.java | 4 +++ src/com/vaadin/ui/Panel.java | 18 +++++++++++ src/com/vaadin/ui/PopupView.java | 10 ++++++ src/com/vaadin/ui/ProgressIndicator.java | 2 ++ src/com/vaadin/ui/RichTextArea.java | 2 ++ src/com/vaadin/ui/Select.java | 6 ++++ src/com/vaadin/ui/Slider.java | 2 ++ src/com/vaadin/ui/TabSheet.java | 29 +++++++++++++++++ src/com/vaadin/ui/Table.java | 21 ++++++++++++ src/com/vaadin/ui/Tree.java | 17 ++++++++++ src/com/vaadin/ui/TreeTable.java | 30 ++++++++++++++++++ src/com/vaadin/ui/Upload.java | 11 +++++++ src/com/vaadin/ui/Window.java | 5 +++ .../vaadin/data/util/AbstractContainerTest.java | 1 + .../com/vaadin/data/util/BeanContainerTest.java | 3 ++ .../com/vaadin/data/util/BeanItemTest.java | 1 + .../com/vaadin/data/util/TestContainerSorting.java | 1 + .../data/util/TestHierarchicalContainer.java | 2 ++ .../data/util/filter/AbstractFilterTest.java | 7 ++++ .../data/util/sqlcontainer/SQLContainerTest.java | 33 +++++++++++++++++++ .../vaadin/data/util/sqlcontainer/TicketTests.java | 3 ++ .../connection/MockInitialContextFactory.java | 1 + ...tractApplicationServletStaticFilesLocation.java | 6 ++++ .../com/vaadin/tests/VaadinClasses.java | 1 + .../tests/data/converter/ConverterFactory.java | 4 +++ .../com/vaadin/tests/server/SourceFileChecker.java | 1 + .../com/vaadin/tests/server/TestEventRouter.java | 2 ++ .../server/TransactionListenersConcurrency.java | 4 +++ .../AbstractFieldValueConversions.java | 12 +++++++ .../abstractfield/RemoveListenersOnDetach.java | 3 ++ .../tests/server/component/button/ButtonClick.java | 1 + .../tests/server/component/menubar/MenuBarIds.java | 1 + .../textfield/TextFieldWithPropertyFormatter.java | 1 + .../tests/server/component/tree/TestListeners.java | 2 ++ .../component/window/AttachDetachWindow.java | 6 ++++ .../ComponentAttachDetachListenerTest.java | 2 ++ .../navigator/ClassBasedViewProviderTest.java | 1 + .../tests/server/navigator/NavigatorTest.java | 6 ++++ .../com/vaadin/launcher/DemoLauncher.java | 2 ++ tests/testbench/com/vaadin/tests/Components.java | 2 ++ .../com/vaadin/tests/CustomLayoutDemo.java | 2 ++ .../com/vaadin/tests/FocusingComponents.java | 1 + .../testbench/com/vaadin/tests/ListenerOrder.java | 6 ++++ tests/testbench/com/vaadin/tests/ModalWindow.java | 1 + .../com/vaadin/tests/NativeWindowing.java | 4 +++ .../vaadin/tests/OrderedLayoutSwapComponents.java | 2 ++ tests/testbench/com/vaadin/tests/Parameters.java | 1 + .../PerformanceTestLabelsAndOrderedLayouts.java | 2 ++ .../tests/PerformanceTestSubTreeCaching.java | 2 ++ .../com/vaadin/tests/ScrollbarStressTest.java | 1 + .../com/vaadin/tests/StressComponentsInTable.java | 1 + .../com/vaadin/tests/TableChangingDatasource.java | 1 + .../com/vaadin/tests/TableSelectTest.java | 1 + tests/testbench/com/vaadin/tests/TestBench.java | 2 ++ .../com/vaadin/tests/TestCaptionWrapper.java | 1 + .../vaadin/tests/TestComponentAddAndRecursion.java | 7 ++++ .../com/vaadin/tests/TestContainerChanges.java | 10 ++++++ .../tests/TestForBasicApplicationLayout.java | 2 ++ .../tests/TestForChildComponentRendering.java | 3 ++ .../vaadin/tests/TestForContainerFilterable.java | 2 ++ .../TestForGridLayoutChildComponentRendering.java | 3 ++ .../vaadin/tests/TestForMultipleStyleNames.java | 1 + .../com/vaadin/tests/TestForNativeWindowing.java | 4 +++ .../tests/TestForPreconfiguredComponents.java | 5 +++ .../com/vaadin/tests/TestForRichTextEditor.java | 2 ++ .../com/vaadin/tests/TestForStyledUpload.java | 12 +++++++ .../com/vaadin/tests/TestForTabSheet.java | 2 ++ ...tForTablesInitialColumnWidthLogicRendering.java | 2 ++ tests/testbench/com/vaadin/tests/TestForTrees.java | 5 +++ .../testbench/com/vaadin/tests/TestForUpload.java | 16 ++++++++++ .../com/vaadin/tests/TestForWindowOpen.java | 3 ++ .../com/vaadin/tests/TestForWindowing.java | 2 ++ .../com/vaadin/tests/TestSetVisibleAndCaching.java | 1 + .../com/vaadin/tests/TestSizeableIncomponents.java | 3 ++ .../testbench/com/vaadin/tests/TreeFilesystem.java | 1 + .../com/vaadin/tests/TreeFilesystemContainer.java | 1 + .../com/vaadin/tests/UpgradingSample.java | 4 +++ .../tests/UsingCustomNewItemHandlerInSelect.java | 1 + .../com/vaadin/tests/UsingObjectsInSelect.java | 1 + .../com/vaadin/tests/appengine/GAESyncTest.java | 3 ++ .../tests/application/ApplicationCloseTest.java | 1 + .../tests/application/ErrorInUnloadEvent.java | 2 ++ .../application/TerminalErrorNotification.java | 1 + .../tests/application/ThreadLocalInstances.java | 1 + .../tests/application/WebBrowserSizeTest.java | 1 + .../vaadin/tests/application/WebBrowserTest.java | 1 + .../tests/applicationcontext/ChangeSessionId.java | 2 ++ .../RemoveTransactionListener.java | 6 ++++ .../components/AbstractComponentContainerTest.java | 19 +++++++++++ .../tests/components/AbstractComponentTest.java | 11 +++++++ .../components/AbstractComponentTestCase.java | 15 +++++++++ .../tests/components/AbstractLayoutTest.java | 3 ++ .../components/AbstractOrderedLayoutTest.java | 3 ++ .../components/AddRemoveSetStyleNamesTest.java | 2 ++ .../vaadin/tests/components/ComponentTestCase.java | 3 ++ .../CustomComponentwithUndefinedSize.java | 1 + .../tests/components/DisableEnableCascade.java | 3 ++ .../components/DisableEnableCascadeStyles.java | 4 +++ .../tests/components/FocusAndBlurListeners.java | 3 ++ .../tests/components/FocusFromShortcutAction.java | 2 ++ .../tests/components/LayoutAttachListenerInfo.java | 7 ++++ .../vaadin/tests/components/TouchScrollables.java | 9 ++++++ ...eComponentsFromAbsoluteLayoutToInnerLayout.java | 2 ++ .../components/abstractcomponent/EnableState.java | 4 +++ .../components/abstractcomponent/TooltipTests.java | 3 ++ .../AbstractComponentDataBindingTest.java | 2 ++ .../AbstractFieldCommitWithInvalidValues.java | 1 + .../AbstractFieldDataSourceReadOnly.java | 1 + .../abstractfield/AbstractFieldTest.java | 6 ++++ .../abstractfield/AbstractTextFieldTest.java | 12 +++++++ .../abstractfield/DateFieldBasedOnLong.java | 1 + .../IntegerDoubleFieldsWithDataSource.java | 1 + .../IntegerFieldWithoutDataSource.java | 1 + .../abstractfield/ShortcutAddAndRemove.java | 3 ++ .../abstractfield/TextFieldConversions.java | 2 ++ .../Vaadin6ImplicitDoubleConverter.java | 4 +++ .../tests/components/accordion/RemoveTabs.java | 4 +++ .../BeanItemContainerNullValues.java | 1 + .../button/ButtonEnterWithWindowShortcut.java | 3 ++ .../components/button/ButtonErrorMessage.java | 1 + .../vaadin/tests/components/button/ButtonHtml.java | 1 + .../components/button/ButtonMouseDetails.java | 1 + .../vaadin/tests/components/button/Buttons2.java | 3 ++ .../button/ShortCutListenerModification.java | 1 + .../button/TooltipForDisabledButton.java | 2 ++ .../tests/components/caption/IconsInCaption.java | 2 ++ .../components/checkbox/CheckBoxNullValue.java | 1 + .../tests/components/checkbox/CheckBoxes2.java | 1 + .../ComboBoxCombinedWithEnterShortcut.java | 1 + .../combobox/ComboBoxDataSourceChange.java | 3 ++ .../combobox/ComboBoxEnablesComboBox.java | 1 + .../combobox/ComboBoxIdenticalItems.java | 1 + .../tests/components/combobox/ComboBoxInPopup.java | 1 + .../combobox/ComboBoxInvalidNullSelection.java | 2 ++ .../combobox/ComboBoxReapperingOldValue.java | 1 + .../tests/components/combobox/ComboBoxSlow.java | 1 + .../components/combobox/ComboBoxSlowInFF.java | 1 + .../combobox/ComboBoxSuggestionOnDetach.java | 1 + .../combobox/ComboBoxTextFieldEventOrder.java | 1 + .../components/combobox/ComboBoxValueUpdate.java | 1 + .../tests/components/combobox/ComboBoxes2.java | 5 +++ .../components/combobox/ComboFocusBlurEvents.java | 2 ++ .../tests/components/combobox/Comboboxes.java | 1 + .../components/combobox/NewItemsESCPress.java | 1 + .../components/combobox/RemovalOfSelectedIcon.java | 1 + .../components/customcomponent/ClipContent.java | 2 ++ .../CustomComponentGrowingContent.java | 1 + .../customcomponent/CustomComponentSizeUpdate.java | 1 + .../customcomponent/CustomLayoutUsingTemplate.java | 1 + .../customcomponent/CustomLayoutUsingTheme.java | 3 ++ .../customfield/AbstractNestedFormExample.java | 1 + .../components/customfield/AddressFormExample.java | 1 + .../tests/components/customfield/BooleanField.java | 1 + .../customfield/BooleanFieldExample.java | 1 + .../components/customfield/NestedPersonForm.java | 2 ++ .../tests/components/datefield/CommitInvalid.java | 3 ++ .../components/datefield/CustomDateFormats.java | 2 ++ .../components/datefield/DateFieldEmptyValid.java | 6 ++++ .../components/datefield/DateFieldInSubWindow.java | 2 ++ .../components/datefield/DateFieldLocale.java | 1 + .../datefield/DateFieldMinResolution.java | 1 + .../datefield/DateFieldRangeValidation.java | 1 + .../components/datefield/DateFieldReadOnly.java | 1 + .../tests/components/datefield/DateFieldTest.java | 5 +++ .../components/datefield/DateFieldTimezone.java | 2 ++ .../datefield/DateFieldUnparsableDate.java | 1 + .../DefaultHandleUnparsableDateField.java | 1 + .../datefield/DisabledDateFieldWidth.java | 1 + .../components/datefield/InlineDateFields.java | 2 ++ .../tests/components/datefield/LenientMode.java | 1 + .../tests/components/datefield/LowResolution.java | 4 +++ .../datefield/PopupDateFieldExtendedRange.java | 1 + .../components/datefield/PopupDateFieldTest.java | 1 + .../components/datefield/PopupDateFields.java | 2 ++ .../datefield/ShowSelectedDateAfterInvalid.java | 1 + .../components/datefield/ValueThroughProperty.java | 2 ++ .../WidthRecalculationOnEnableStateChange.java | 2 ++ .../DragAndDropWrapperTooltips.java | 2 ++ .../tests/components/embedded/EmbeddedAltText.java | 1 + .../EmbeddedClickListenerRelativeCoordinates.java | 1 + .../components/embedded/EmbeddedImageRefresh.java | 5 +++ .../tests/components/embedded/EmbeddedPdf.java | 1 + .../form/FormClearDatasourceRepaint.java | 2 ++ .../form/FormCommitWithInvalidValues.java | 1 + .../tests/components/form/FormDescription.java | 1 + .../components/form/FormRenderingFlicker.java | 1 + .../com/vaadin/tests/components/form/FormTest.java | 8 +++++ .../components/form/FormWithEnterShortCut.java | 1 + .../form/FormWithPropertyFormatterConnected.java | 1 + .../formlayout/FormLayoutCaptionStyles.java | 1 + .../components/gridlayout/GridLayoutInForm.java | 3 ++ .../MoveComponentsFromGridLayoutToInnerLayout.java | 2 ++ .../BasicJavaScriptComponent.java | 3 ++ .../label/HundredPercentWideLabelResize.java | 1 + .../vaadin/tests/components/label/LabelTest.java | 4 +++ .../tests/components/label/LabelWrapping.java | 1 + .../tests/components/link/LinkToPercentage.java | 1 + .../tests/components/listselect/ListSelects.java | 2 ++ .../tests/components/loginform/LoginFormTest.java | 4 +++ .../loginform/LoginFormWithMultipleWindows.java | 1 + .../com/vaadin/tests/components/media/Media.java | 4 +++ .../tests/components/menubar/MenuBarHtmlItems.java | 1 + .../components/menubar/MenuBarNavigation.java | 1 + .../menubar/MenuBarRootItemSelectWithKeyboard.java | 1 + .../tests/components/menubar/MenuBarTest.java | 12 +++++++ .../components/nativebutton/NativeButtonHtml.java | 1 + .../components/nativeselect/NativeSelects.java | 1 + .../components/notification/Notifications.java | 1 + .../notification/NotificationsAndModalWindow.java | 1 + .../notification/NotificationsHtmlAllowed.java | 1 + .../optiongroup/DisabledOptionGroupItems.java | 2 ++ .../optiongroup/HtmlOptionGroupItems.java | 3 ++ .../OptionGroupMultipleValueChange.java | 1 + .../tests/components/optiongroup/OptionGroups.java | 3 ++ .../orderedlayout/LayoutClickListenerTest.java | 1 + .../components/orderedlayout/LayoutResizeTest.java | 2 ++ .../orderedlayout/OrderedLayoutCases.java | 18 +++++++++++ .../orderedlayout/ReplaceComponentNPE.java | 1 + .../VerticalLayoutWidthCalculation.java | 1 + .../tests/components/panel/BasicPanelTest.java | 1 + .../components/panel/PanelChangeContents.java | 1 + .../PanelClickListenerRelativeCoordinates.java | 1 + .../components/panel/PanelShouldNotScroll.java | 1 + .../panel/PanelShouldRemoveActionHandler.java | 7 ++++ .../components/popupview/PopupViewNullValues.java | 4 +++ .../components/popupview/PopupViewOffScreen.java | 1 + .../popupview/PopupViewShouldCloseOnTabOut.java | 2 ++ .../components/popupview/PopupViewWithRTE.java | 2 ++ .../components/popupview/ReopenPopupView.java | 1 + .../ProgressIndicatorInvisible.java | 1 + .../components/richtextarea/RichTextAreaTest.java | 2 ++ .../RichTextAreaWithKeyboardShortcuts.java | 2 ++ .../tests/components/root/UriFragmentTest.java | 2 ++ .../components/select/AbstractSelectTestCase.java | 7 ++++ .../select/ComboBoxAddWhileFiltering.java | 1 + .../select/FocusListenerBreaksDropdownMenu.java | 1 + .../tests/components/select/NativeSelects.java | 1 + .../components/select/NullSelectionItemId.java | 3 ++ .../components/select/SelectDisplaysOldValue.java | 1 + .../components/select/StylingPopupOpener.java | 1 + .../select/TwinColSelectCaptionStyles.java | 1 + .../tests/components/select/TwinColSelectTest.java | 4 +++ .../vaadin/tests/components/slider/SliderTest.java | 4 +++ .../splitpanel/AbstractSplitPanelTest.java | 4 +++ .../splitpanel/SplitPanelExtraScrollbars.java | 1 + .../splitpanel/SplitPanelReversePosition.java | 4 +++ .../splitpanel/SplitPanelSplitterWidth.java | 1 + .../splitpanel/SplitPanelSwapComponents.java | 1 + .../SplitPanelWithMinimumAndMaximum.java | 4 +++ .../components/table/AddItemToEmptyTable.java | 4 +++ .../tests/components/table/AddNonRenderedRow.java | 1 + .../components/table/CellStyleGeneratorTest.java | 1 + .../table/ColumnCollapsingAndColumnExpansion.java | 4 +++ .../table/ColumnGeneratorAddingOrder.java | 2 ++ .../components/table/ColumnHeaderAlignments.java | 2 ++ .../tests/components/table/ColumnReorderEvent.java | 1 + .../tests/components/table/ColumnResizeEvent.java | 1 + .../ContainerChangeWithPartlySamePropertyIds.java | 2 ++ .../components/table/ContainerSizeChange.java | 2 ++ ...isabledTableShouldNotSendPageLengthUpdates.java | 1 + .../tests/components/table/DoublesInTable.java | 20 ++++++++++++ .../tests/components/table/EditableModeChange.java | 1 + .../tests/components/table/EditableTableLeak.java | 3 ++ .../com/vaadin/tests/components/table/Footer.java | 4 +++ .../vaadin/tests/components/table/FooterClick.java | 3 ++ .../vaadin/tests/components/table/HeaderClick.java | 4 +++ .../table/HeaderFooterClickLeftRightMiddle.java | 7 ++++ .../components/table/HeaderUpdateWhenNoRows.java | 1 + .../table/HiddenColumnsExpandRatios.java | 2 ++ .../tests/components/table/HugeRowCount.java | 1 + .../tests/components/table/ItemClickEvents.java | 4 +++ .../vaadin/tests/components/table/KeyControl.java | 3 ++ .../KeyboardNavigationWithChangingContent.java | 1 + .../table/LabelEmbeddedClickThroughForTable.java | 1 + .../tests/components/table/LastColumnNegative.java | 3 ++ .../tests/components/table/LongMultiselect.java | 1 + .../tests/components/table/MissingScrollbar.java | 2 ++ .../components/table/ModifyContainerProperty.java | 2 ++ .../table/MultiClickingItemThatDetachesTable.java | 1 + .../table/MultiSelectWithNotIdentityEqualIds.java | 1 + .../table/ProgrammaticUnselectInRange.java | 2 ++ .../components/table/PropertyValueChange.java | 3 ++ .../tests/components/table/RowAdditionTest.java | 3 ++ .../tests/components/table/RowGenerators.java | 1 + .../table/RowUpdateShouldRetainContextMenu.java | 3 ++ .../table/SafariRenderingBugWhiteSpace.java | 1 + .../table/ScrollDetachSynchronization.java | 2 ++ .../table/SelectingItemScrollsRight.java | 1 + .../table/SetCurrentPageFirstItemId.java | 1 + .../table/TableAndBrowserContextMenu.java | 7 ++++ .../table/TableCacheBuildEfficiency.java | 1 + .../TableClickAndDragOnIconAndComponents.java | 6 ++++ .../table/TableClickValueChangeInteraction.java | 2 ++ .../table/TableColumnResizeContentsWidth.java | 3 ++ .../tests/components/table/TableContextMenu.java | 2 ++ .../components/table/TableContextMenuOnField.java | 7 ++++ .../table/TableHeightWhenHidingHeaders.java | 1 + .../table/TableItemDescriptionGeneratorTest.java | 2 ++ .../table/TableModifcationsWhenScrolledRight.java | 1 + .../components/table/TableMultiSelectSimple.java | 1 + .../components/table/TablePageLengthUpdate.java | 1 + .../table/TableRepaintWhenMadeVisibile.java | 2 ++ .../tests/components/table/TableRowHeight.java | 2 ++ .../tests/components/table/TableScrollOnFocus.java | 1 + .../table/TableShouldNotEatValueChanges.java | 1 + .../tests/components/table/TableSingleSelect.java | 1 + .../tests/components/table/TableSorting.java | 1 + .../components/table/TableToggleVisibility.java | 1 + .../tests/components/table/TableUndefinedSize.java | 7 ++++ .../components/table/TableUnregisterComponent.java | 2 ++ .../table/TableVisibleColumnsUpdate.java | 1 + .../components/table/TableWithChildComponents.java | 2 ++ ...TableWithContainerRequiringEqualsForItemId.java | 3 ++ .../table/TableWithNoncollapsibleColumns.java | 4 +++ .../com/vaadin/tests/components/table/Tables.java | 36 +++++++++++++++++++++ .../components/table/TestCurrentPageFirstItem.java | 1 + .../components/table/TextFieldRelativeWidth.java | 2 ++ .../table/TextFieldValueGoesMissing.java | 1 + .../components/table/UncollapsedCollumnWidth.java | 1 + .../components/tabsheet/AddAndRemoveTabs.java | 2 ++ .../components/tabsheet/PreventTabChange.java | 1 + .../tests/components/tabsheet/RemoveTabs.java | 5 +++ .../tabsheet/TabGetAndReplaceComponent.java | 1 + .../components/tabsheet/TabKeyboardNavigation.java | 4 +++ .../components/tabsheet/TabSheetCaptions.java | 2 ++ .../components/tabsheet/TabSheetDisabling.java | 3 ++ .../tabsheet/TabSheetDiscardsMovedComponents.java | 1 + .../tabsheet/TabSheetIndexOperations.java | 4 +++ .../tests/components/tabsheet/TabSheetMinimal.java | 1 + .../components/tabsheet/TabSheetTabStyleNames.java | 1 + .../tests/components/tabsheet/TabSheetTest.java | 10 ++++++ .../tests/components/tabsheet/TabsheetNPE.java | 1 + .../components/tabsheet/TabsheetScrolling.java | 2 ++ .../tabsheet/WrapTabSheetInTabSheet.java | 1 + .../textarea/TextAreaCursorPosition.java | 1 + .../tests/components/textarea/TextAreaTest.java | 2 ++ .../vaadin/tests/components/textarea/Wordwrap.java | 1 + .../EnterShortcutMaySendInputPromptAsValue.java | 3 ++ .../textfield/MultipleTextChangeEvents.java | 3 ++ .../OutOfSyncIssueWithKeyboardShortcut.java | 2 ++ .../textfield/SelectionAndCursorPosition.java | 4 +++ .../tests/components/textfield/SetTabIndex.java | 1 + .../components/textfield/TextChangeEvents.java | 2 ++ .../components/textfield/TextChangeEvents2.java | 12 +++++++ .../textfield/TextChangeEventsEternalLoop.java | 1 + ...extChangeEventsWithNonImmediateValueChange.java | 2 ++ ...extChangeListenerChangingNonTextProperties.java | 1 + .../textfield/TextChangeTimeoutAfterDetach.java | 2 ++ .../textfield/TextFieldEagerRepaint.java | 2 ++ .../textfield/TextFieldFocusAndBlurListeners.java | 6 ++++ .../TextFieldInputPromptAndClickShortcut.java | 2 ++ .../textfield/TextFieldWithProperty.java | 1 + .../textfield/TextFieldWithPropertyFormatter.java | 7 ++++ .../components/tree/CtrlShiftMultiselect.java | 1 + .../tests/components/tree/ExpandCollapseTree.java | 1 + .../tests/components/tree/ItemStyleGenerator.java | 1 + .../tests/components/tree/TreeConnectors.java | 3 ++ .../tests/components/tree/TreeContainerChange.java | 3 ++ .../components/tree/TreeDragAndDropFromTable.java | 2 ++ .../tests/components/tree/TreeFiltering.java | 8 +++++ .../tests/components/tree/TreeFocusGaining.java | 3 ++ .../components/tree/TreeItemClickListening.java | 1 + .../components/tree/TreeScrollingOnSelection.java | 1 + .../vaadin/tests/components/tree/TreeToolTips.java | 1 + .../tree/TreeWithPreselectedItemNotShown.java | 1 + .../com/vaadin/tests/components/tree/Trees.java | 16 ++++++++++ .../components/treetable/AddNodesOnExpand.java | 2 ++ .../treetable/ChangeDataSourcePageLengthZero.java | 3 ++ .../components/treetable/DynamicallyModified.java | 2 ++ .../components/treetable/KeepAllItemsVisible.java | 6 ++++ .../components/treetable/ProgrammaticCollapse.java | 3 ++ .../components/treetable/ProgrammaticSelect.java | 1 + .../treetable/RemoveAllItemsRefresh.java | 2 ++ .../treetable/TreeTableCacheOnPartialUpdates.java | 6 ++++ .../treetable/TreeTableModifyAndSetCollapsed.java | 1 + .../components/treetable/TreeTableOutOfSync.java | 2 ++ .../treetable/TreeTableSetCollapsed.java | 1 + .../tests/components/treetable/TreeTableTest.java | 11 +++++++ .../components/twincolselect/TwinColSelects.java | 2 ++ .../tests/components/upload/ForceSubmit.java | 5 +++ .../tests/components/upload/TestFileUpload.java | 3 ++ .../upload/TestImmediateUploadInFormLayout.java | 1 + .../vaadin/tests/components/upload/TestUpload.java | 2 ++ .../upload/TestUploadAndDisableOnSuccess.java | 4 +++ .../components/upload/TestUploadFilename.java | 2 ++ .../window/AttachShouldBeCalledForSubWindows.java | 3 ++ .../tests/components/window/CloseSubWindow.java | 4 +++ .../tests/components/window/DownloadAndUpdate.java | 1 + .../tests/components/window/ExecuteJavaScript.java | 1 + .../tests/components/window/ExtraWindowShown.java | 2 ++ .../tests/components/window/LazyWindowResize.java | 5 +++ .../tests/components/window/LongNotifications.java | 4 +++ .../components/window/RepaintWindowContents.java | 2 ++ .../tests/components/window/SubWindowFocus.java | 3 ++ .../window/SubWindowFocusAndBlurListeners.java | 5 +++ .../tests/components/window/SubWindowOrder.java | 1 + .../window/SubWindowWithUndefinedHeight.java | 2 ++ .../vaadin/tests/components/window/SubWindows.java | 2 ++ .../components/window/SubwindowDraggability.java | 1 + .../window/UndefinedHeightSubWindowAndContent.java | 1 + .../tests/components/window/WindowClickEvents.java | 5 +++ .../components/window/WindowResizeListener.java | 4 +++ .../window/WindowScrollingComponentIntoView.java | 4 +++ .../tests/components/window/WindowScrollingUp.java | 1 + .../window/WindowShouldRemoveActionHandler.java | 7 ++++ .../tests/components/window/WindowStyleNames.java | 3 ++ .../containers/BeanItemContainerFilteringTest.java | 4 +++ .../containers/HierarchicalWrapperOrdering.java | 1 + .../containers/IndexedContainerFilteringTest.java | 4 +++ .../vaadin/tests/containers/TestItemSorter.java | 1 + .../FileSystemContainerInTreeTable.java | 5 +++ .../sqlcontainer/CheckboxUpdateProblem.java | 3 ++ .../sqlcontainer/MassInsertMemoryLeakTestApp.java | 1 + .../converter/ConverterThatEnforcesAFormat.java | 1 + .../com/vaadin/tests/dd/AcceptAnythingWindow.java | 2 ++ .../com/vaadin/tests/dd/AcceptFromComponent.java | 3 ++ .../vaadin/tests/dd/ActiveDragSourceClassName.java | 3 ++ .../vaadin/tests/dd/CustomDDImplementation.java | 4 +++ tests/testbench/com/vaadin/tests/dd/DDTest1.java | 3 ++ tests/testbench/com/vaadin/tests/dd/DDTest2.java | 6 ++++ tests/testbench/com/vaadin/tests/dd/DDTest4.java | 2 ++ tests/testbench/com/vaadin/tests/dd/DDTest5.java | 2 ++ tests/testbench/com/vaadin/tests/dd/DDTest6.java | 18 +++++++++++ tests/testbench/com/vaadin/tests/dd/DDTest7.java | 2 ++ tests/testbench/com/vaadin/tests/dd/DDTest8.java | 2 ++ .../com/vaadin/tests/dd/DragAndDropFiles.java | 9 ++++++ .../com/vaadin/tests/dd/DragDropPane.java | 9 ++++++ .../dd/HorizontalLayoutSortableWithWrappers.java | 2 ++ .../HorizontalSortableCssLayoutWithWrappers.java | 2 ++ .../com/vaadin/tests/dd/MyDragSourceConnector.java | 1 + .../com/vaadin/tests/dd/MyDropTargetConnector.java | 1 + .../vaadin/tests/dd/NotPaintedAcceptSource.java | 3 ++ .../tests/dd/NotPaintedAcceptSourceInTabSheet.java | 2 ++ .../com/vaadin/tests/dd/ScrolledDropTarget.java | 3 ++ .../com/vaadin/tests/dd/StartHtml5Drag.java | 2 ++ .../com/vaadin/tests/dd/TreeDragStart.java | 6 ++++ .../com/vaadin/tests/dd/VMyDragSource.java | 3 ++ .../com/vaadin/tests/dd/VMyDropTarget.java | 7 ++++ .../tests/extensions/HelloWorldExtension.java | 1 + .../tests/extensions/HelloWorldExtensionTest.java | 1 + .../tests/extensions/JavascriptManagerTest.java | 1 + .../extensions/SimpleJavaScriptExtensionTest.java | 4 +++ .../fieldgroup/AbstractBeanFieldGroupTest.java | 3 ++ .../vaadin/tests/fieldgroup/BasicPersonForm.java | 5 +++ .../fieldgroup/FieldBinderWithBeanValidation.java | 3 ++ .../vaadin/tests/integration/EmbedSizeTest.java | 2 ++ .../integration/IntegrationTestApplication.java | 1 + .../tests/integration/JSR286PortletRoot.java | 5 +++ .../vaadin/tests/integration/LiferayThemeDemo.java | 10 ++++++ .../tests/layouts/AbsoluteLayoutAddRemove.java | 1 + .../vaadin/tests/layouts/CaptionsInLayouts.java | 5 +++ .../ComplexGLColumnExpansionWithColSpan.java | 2 ++ .../vaadin/tests/layouts/CssLayoutCustomCss.java | 2 ++ .../tests/layouts/CssLayoutRemoveComponent.java | 1 + .../CssLayoutRemoveComponentWithCaption.java | 1 + .../layouts/CssLayoutSizeChangePropagation.java | 1 + .../vaadin/tests/layouts/DeepComponentTrees.java | 2 ++ .../layouts/FormLayoutWithInvisibleComponent.java | 1 + .../vaadin/tests/layouts/GridLayoutCaptions.java | 3 ++ .../layouts/GridLayoutExpandRatioModification.java | 1 + .../tests/layouts/GridLayoutMoveComponent.java | 3 ++ .../com/vaadin/tests/layouts/GridLayoutNPE.java | 2 ++ .../tests/layouts/GridLayoutRemoveFinalRow.java | 1 + .../tests/layouts/GridLayoutWidthChange.java | 1 + .../tests/layouts/HiddenHorizontalLayout.java | 1 + .../tests/layouts/LayoutPerformanceTests.java | 2 ++ .../MovingComponentsWhileOldParentInvisible.java | 2 ++ .../vaadin/tests/layouts/MovingInvisibleField.java | 1 + .../vaadin/tests/layouts/OrderedLayoutBasics.java | 3 ++ .../vaadin/tests/layouts/TestAbsoluteLayout.java | 5 +++ .../tests/layouts/TestLayoutClickListeners.java | 6 ++++ .../tests/layouts/TestLayoutPerformance.java | 1 + .../VerticalLayoutExpandRatioModification.java | 1 + ...tWithRelativeSizeComponentsInitiallyHidden.java | 1 + .../layouts/layouttester/GridLayoutTests.java | 22 +++++++++++++ .../layouttester/HorizontalLayoutTests.java | 18 +++++++++++ .../layouttester/LayoutTesterApplication.java | 2 ++ .../layouts/layouttester/VerticalLayoutTests.java | 18 +++++++++++ .../tests/minitutorials/v7a1/DynamicImageRoot.java | 1 + .../v7a1/FindCurrentRootAndApplication.java | 2 ++ .../v7a1/IntegerTextFieldDataSource.java | 1 + .../v7a1/IntegerTextFieldStandalone.java | 1 + .../minitutorials/v7a1/StringMyTypeConverter.java | 5 +++ .../minitutorials/v7a1/UsingUriFragments.java | 2 ++ .../tests/minitutorials/v7a2/MyComponent.java | 1 + .../minitutorials/v7a2/MyPickerConnector.java | 2 ++ .../tests/minitutorials/v7a2/MyPickerWidget.java | 1 + .../tests/minitutorials/v7a2/WidgetContainer.java | 3 ++ .../minitutorials/v7a2/WidgetcontainerRoot.java | 1 + .../tests/minitutorials/v7a3/AnalyticsRoot.java | 1 + .../com/vaadin/tests/minitutorials/v7a3/Flot.java | 2 ++ .../minitutorials/v7a3/FlotJavaScriptRoot.java | 1 + .../tests/requesthandlers/AppResource404.java | 1 + .../tests/resources/DownloadLargeFileResource.java | 1 + .../tests/resources/NonExistingFileResource.java | 1 + .../vaadin/tests/resources/ResourceDownload.java | 6 ++++ .../vaadin/tests/serialization/SerializerTest.java | 18 +++++++++++ .../com/vaadin/tests/themes/ButtonsTest.java | 5 +++ .../com/vaadin/tests/tickets/Ticket1230.java | 9 ++++++ .../com/vaadin/tests/tickets/Ticket124.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1365.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1368.java | 1 + .../com/vaadin/tests/tickets/Ticket1397.java | 11 +++++++ .../com/vaadin/tests/tickets/Ticket1435.java | 2 ++ .../tests/tickets/Ticket1465ModalNotification.java | 5 +++ .../com/vaadin/tests/tickets/Ticket1506_Panel.java | 1 + .../tests/tickets/Ticket1506_TestContainer.java | 13 ++++++++ .../tests/tickets/Ticket1506_TestContainer2.java | 13 ++++++++ .../com/vaadin/tests/tickets/Ticket1572.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1581.java | 1 + .../com/vaadin/tests/tickets/Ticket1589.java | 1 + .../com/vaadin/tests/tickets/Ticket1598.java | 7 ++++ .../com/vaadin/tests/tickets/Ticket161.java | 1 + .../com/vaadin/tests/tickets/Ticket1632.java | 1 + .../com/vaadin/tests/tickets/Ticket1659.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1673.java | 1 + .../com/vaadin/tests/tickets/Ticket1710.java | 3 ++ .../com/vaadin/tests/tickets/Ticket1772.java | 1 + .../com/vaadin/tests/tickets/Ticket1775.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1804.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1805.java | 1 + .../com/vaadin/tests/tickets/Ticket1806.java | 3 ++ .../com/vaadin/tests/tickets/Ticket1811.java | 1 + .../com/vaadin/tests/tickets/Ticket1819.java | 1 + .../tests/tickets/Ticket1834PanelScrolling.java | 4 +++ .../com/vaadin/tests/tickets/Ticket1857.java | 5 +++ .../com/vaadin/tests/tickets/Ticket1878.java | 3 ++ .../com/vaadin/tests/tickets/Ticket1900.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1919.java | 1 + .../com/vaadin/tests/tickets/Ticket1921.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1939.java | 1 + .../com/vaadin/tests/tickets/Ticket1969.java | 5 +++ .../com/vaadin/tests/tickets/Ticket1970.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1973.java | 1 + .../com/vaadin/tests/tickets/Ticket1973_2.java | 1 + .../com/vaadin/tests/tickets/Ticket1975.java | 1 + .../com/vaadin/tests/tickets/Ticket1982.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1983.java | 2 ++ .../com/vaadin/tests/tickets/Ticket1995.java | 1 + .../com/vaadin/tests/tickets/Ticket20.java | 3 ++ .../com/vaadin/tests/tickets/Ticket2001.java | 1 + .../com/vaadin/tests/tickets/Ticket2007.java | 1 + .../com/vaadin/tests/tickets/Ticket2009.java | 3 ++ .../com/vaadin/tests/tickets/Ticket2014.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2021.java | 1 + .../com/vaadin/tests/tickets/Ticket2023.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2029.java | 1 + .../com/vaadin/tests/tickets/Ticket2037.java | 1 + .../com/vaadin/tests/tickets/Ticket2038.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2042.java | 1 + .../com/vaadin/tests/tickets/Ticket2048.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2053.java | 3 ++ .../com/vaadin/tests/tickets/Ticket2060.java | 1 + .../com/vaadin/tests/tickets/Ticket2061.java | 1 + .../com/vaadin/tests/tickets/Ticket2061b.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2061c.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2090.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2099.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2104.java | 3 ++ .../com/vaadin/tests/tickets/Ticket2106.java | 1 + .../com/vaadin/tests/tickets/Ticket2107.java | 3 ++ .../com/vaadin/tests/tickets/Ticket2117.java | 1 + .../com/vaadin/tests/tickets/Ticket2119.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2125.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2126.java | 1 + .../com/vaadin/tests/tickets/Ticket2179.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2181.java | 1 + .../com/vaadin/tests/tickets/Ticket2204.java | 3 ++ .../com/vaadin/tests/tickets/Ticket2208.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2209.java | 1 + .../com/vaadin/tests/tickets/Ticket2209OL.java | 1 + .../com/vaadin/tests/tickets/Ticket2209OL2.java | 1 + .../com/vaadin/tests/tickets/Ticket2221.java | 1 + .../com/vaadin/tests/tickets/Ticket2242.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2244.java | 4 +++ .../com/vaadin/tests/tickets/Ticket2267.java | 1 + .../com/vaadin/tests/tickets/Ticket2282.java | 1 + .../com/vaadin/tests/tickets/Ticket2289.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2292.java | 1 + .../com/vaadin/tests/tickets/Ticket2310.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2329.java | 1 + .../com/vaadin/tests/tickets/Ticket2337.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2347.java | 1 + .../com/vaadin/tests/tickets/Ticket2365.java | 1 + .../com/vaadin/tests/tickets/Ticket2406.java | 1 + .../com/vaadin/tests/tickets/Ticket2415.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2431.java | 2 ++ .../com/vaadin/tests/tickets/Ticket2436.java | 3 ++ .../com/vaadin/tests/tickets/Ticket2526.java | 1 + .../com/vaadin/tests/tickets/Ticket2998.java | 1 + .../com/vaadin/tests/tickets/Ticket3146.java | 4 +++ .../com/vaadin/tests/tickets/Ticket34.java | 2 ++ .../com/vaadin/tests/tickets/Ticket6002.java | 2 ++ .../com/vaadin/tests/tickets/Ticket677.java | 5 +++ .../com/vaadin/tests/tickets/Ticket695.java | 1 + .../com/vaadin/tests/tickets/Ticket736.java | 4 +++ .../com/vaadin/tests/tickets/Ticket846.java | 1 + .../com/vaadin/tests/tickets/Ticket932.java | 2 ++ .../com/vaadin/tests/util/TestClickListener.java | 1 + .../validation/EmptyFieldErrorIndicators.java | 2 ++ .../vaadin/tests/validation/TestValidators.java | 1 + .../ValidationOfRequiredEmptyFields.java | 4 +++ .../widgetset/client/SerializerTestConnector.java | 18 +++++++++++ .../HelloWorldExtensionConnector.java | 1 + .../minitutorials/v7a2/MyComponentConnector.java | 2 ++ .../v7a2/WidgetContainerConnector.java | 1 + 867 files changed, 3243 insertions(+) (limited to 'src/com/vaadin/terminal/gwt') diff --git a/src/com/vaadin/data/Container.java b/src/com/vaadin/data/Container.java index f722e07741..f4c0ed9794 100644 --- a/src/com/vaadin/data/Container.java +++ b/src/com/vaadin/data/Container.java @@ -697,6 +697,7 @@ public interface Container extends Serializable { * @return true if the operation succeeded, * false if not */ + @Override public boolean removeItem(Object itemId) throws UnsupportedOperationException; } diff --git a/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java b/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java index 569f643998..be0db328f2 100644 --- a/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java +++ b/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java @@ -23,6 +23,7 @@ public class DefaultFieldGroupFieldFactory implements FieldGroupFieldFactory { public static final Object CAPTION_PROPERTY_ID = "Caption"; + @Override public T createField(Class type, Class fieldType) { if (Enum.class.isAssignableFrom(type)) { return createEnumField(type, fieldType); diff --git a/src/com/vaadin/data/util/AbstractBeanContainer.java b/src/com/vaadin/data/util/AbstractBeanContainer.java index 300f92ea3a..2f428d2cb6 100644 --- a/src/com/vaadin/data/util/AbstractBeanContainer.java +++ b/src/com/vaadin/data/util/AbstractBeanContainer.java @@ -96,6 +96,7 @@ public abstract class AbstractBeanContainer extends this.propertyId = propertyId; } + @Override @SuppressWarnings("unchecked") public IDTYPE getIdForBean(BEANTYPE bean) throws IllegalArgumentException { @@ -163,6 +164,7 @@ public abstract class AbstractBeanContainer extends * * @see com.vaadin.data.Container#getType(java.lang.Object) */ + @Override public Class getType(Object propertyId) { return model.get(propertyId).getPropertyType(); } @@ -195,6 +197,7 @@ public abstract class AbstractBeanContainer extends * * @see com.vaadin.data.Container#getContainerPropertyIds() */ + @Override public Collection getContainerPropertyIds() { return model.keySet(); } @@ -258,6 +261,7 @@ public abstract class AbstractBeanContainer extends * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ + @Override public Property getContainerProperty(Object itemId, Object propertyId) { Item item = getItem(itemId); if (item == null) { @@ -300,6 +304,7 @@ public abstract class AbstractBeanContainer extends /** * Re-filter the container when one of the monitored properties changes. */ + @Override public void valueChange(ValueChangeEvent event) { // if a property that is used in a filter is changed, refresh filtering filterAll(); @@ -312,6 +317,7 @@ public abstract class AbstractBeanContainer extends * com.vaadin.data.Container.Filterable#addContainerFilter(java.lang.Object, * java.lang.String, boolean, boolean) */ + @Override public void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix) { try { @@ -328,6 +334,7 @@ public abstract class AbstractBeanContainer extends * * @see com.vaadin.data.Container.Filterable#removeAllContainerFilters() */ + @Override public void removeAllContainerFilters() { if (!getFilters().isEmpty()) { for (Item item : itemIdToItem.values()) { @@ -344,6 +351,7 @@ public abstract class AbstractBeanContainer extends * com.vaadin.data.Container.Filterable#removeContainerFilters(java.lang * .Object) */ + @Override public void removeContainerFilters(Object propertyId) { Collection removedFilters = super.removeFilters(propertyId); if (!removedFilters.isEmpty()) { @@ -354,11 +362,13 @@ public abstract class AbstractBeanContainer extends } } + @Override public void addContainerFilter(Filter filter) throws UnsupportedFilterException { addFilter(filter); } + @Override public void removeContainerFilter(Filter filter) { removeFilter(filter); } @@ -416,6 +426,7 @@ public abstract class AbstractBeanContainer extends * * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() */ + @Override public Collection getSortableContainerPropertyIds() { return getSortablePropertyIds(); } @@ -426,6 +437,7 @@ public abstract class AbstractBeanContainer extends * @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], * boolean[]) */ + @Override public void sort(Object[] propertyId, boolean[] ascending) { sortContainer(propertyId, ascending); } diff --git a/src/com/vaadin/data/util/AbstractContainer.java b/src/com/vaadin/data/util/AbstractContainer.java index 58a3a8687a..7d96c2d757 100644 --- a/src/com/vaadin/data/util/AbstractContainer.java +++ b/src/com/vaadin/data/util/AbstractContainer.java @@ -52,6 +52,7 @@ public abstract class AbstractContainer implements Container { super(source); } + @Override public Container getContainer() { return (Container) getSource(); } @@ -72,6 +73,7 @@ public abstract class AbstractContainer implements Container { super(source); } + @Override public Container getContainer() { return (Container) getSource(); } diff --git a/src/com/vaadin/data/util/AbstractInMemoryContainer.java b/src/com/vaadin/data/util/AbstractInMemoryContainer.java index 795aabb419..b7832756f2 100644 --- a/src/com/vaadin/data/util/AbstractInMemoryContainer.java +++ b/src/com/vaadin/data/util/AbstractInMemoryContainer.java @@ -125,6 +125,7 @@ public abstract class AbstractInMemoryContainer getItemIds() { return Collections.unmodifiableList(getVisibleItemIds()); } // Container.Ordered + @Override public ITEMIDTYPE nextItemId(Object itemId) { int index = indexOfId(itemId); if (index >= 0 && index < size() - 1) { @@ -181,6 +186,7 @@ public abstract class AbstractInMemoryContainer 0) { @@ -191,6 +197,7 @@ public abstract class AbstractInMemoryContainer 0) { return getIdByIndex(0); @@ -199,6 +206,7 @@ public abstract class AbstractInMemoryContainer 0) { return getIdByIndex(size() - 1); @@ -207,6 +215,7 @@ public abstract class AbstractInMemoryContainer type, Object defaultValue) throws UnsupportedOperationException { throw new UnsupportedOperationException( "Adding container properties not supported. Override the addContainerProperty() method if required."); } + @Override public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { throw new UnsupportedOperationException( diff --git a/src/com/vaadin/data/util/AbstractProperty.java b/src/com/vaadin/data/util/AbstractProperty.java index 3b6db3807e..373a8dfd58 100644 --- a/src/com/vaadin/data/util/AbstractProperty.java +++ b/src/com/vaadin/data/util/AbstractProperty.java @@ -42,10 +42,12 @@ public abstract class AbstractProperty implements Property, * Override for additional restrictions on what is considered a read-only * property. */ + @Override public boolean isReadOnly() { return readOnly; } + @Override public void setReadOnly(boolean newStatus) { boolean oldStatus = isReadOnly(); readOnly = newStatus; @@ -93,6 +95,7 @@ public abstract class AbstractProperty implements Property, * * @return source Property of the event. */ + @Override public Property getProperty() { return (Property) getSource(); } @@ -105,6 +108,7 @@ public abstract class AbstractProperty implements Property, * @param listener * the new Listener to be registered. */ + @Override public void addListener(Property.ReadOnlyStatusChangeListener listener) { if (readOnlyStatusChangeListeners == null) { readOnlyStatusChangeListeners = new LinkedList(); @@ -118,6 +122,7 @@ public abstract class AbstractProperty implements Property, * @param listener * the listener to be removed. */ + @Override public void removeListener(Property.ReadOnlyStatusChangeListener listener) { if (readOnlyStatusChangeListeners != null) { readOnlyStatusChangeListeners.remove(listener); @@ -161,12 +166,14 @@ public abstract class AbstractProperty implements Property, * * @return source Property of the event. */ + @Override public Property getProperty() { return (Property) getSource(); } } + @Override public void addListener(ValueChangeListener listener) { if (valueChangeListeners == null) { valueChangeListeners = new LinkedList(); @@ -175,6 +182,7 @@ public abstract class AbstractProperty implements Property, } + @Override public void removeListener(ValueChangeListener listener) { if (valueChangeListeners != null) { valueChangeListeners.remove(listener); diff --git a/src/com/vaadin/data/util/BeanItemContainer.java b/src/com/vaadin/data/util/BeanItemContainer.java index 245a623d5d..dc4deaebdc 100644 --- a/src/com/vaadin/data/util/BeanItemContainer.java +++ b/src/com/vaadin/data/util/BeanItemContainer.java @@ -59,6 +59,7 @@ public class BeanItemContainer extends private static class IdentityBeanIdResolver implements BeanIdResolver { + @Override public BT getIdForBean(BT bean) { return bean; } diff --git a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java index 9159fa358b..717ce834cf 100644 --- a/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java +++ b/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java @@ -71,6 +71,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, this.itemIds = itemIds; } + @Override public int compare(Object o1, Object o2) { if (o1.equals(o2)) { return 0; @@ -233,6 +234,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Can the specified Item have any children? Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public boolean areChildrenAllowed(Object itemId) { // If the wrapped container implements the method directly, use it @@ -253,6 +255,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * comment here, we use the default documentation from implemented * interface. */ + @Override public Collection getChildren(Object itemId) { // If the wrapped container implements the method directly, use it @@ -272,6 +275,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * comment here, we use the default documentation from implemented * interface. */ + @Override public Object getParent(Object itemId) { // If the wrapped container implements the method directly, use it @@ -287,6 +291,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public boolean hasChildren(Object itemId) { // If the wrapped container implements the method directly, use it @@ -303,6 +308,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public boolean isRoot(Object itemId) { // If the wrapped container implements the method directly, use it @@ -322,6 +328,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * comment here, we use the default documentation from implemented * interface. */ + @Override public Collection rootItemIds() { // If the wrapped container implements the method directly, use it @@ -351,6 +358,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @return true if the operation succeeded, false * if not */ + @Override public boolean setChildrenAllowed(Object itemId, boolean childrenAllowed) { // If the wrapped container implements the method directly, use it @@ -391,6 +399,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @return true if the operation succeeded, false * if not */ + @Override public boolean setParent(Object itemId, Object newParentId) { // If the wrapped container implements the method directly, use it @@ -483,6 +492,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @throws UnsupportedOperationException * if the addItem is not supported. */ + @Override public Object addItem() throws UnsupportedOperationException { final Object id = container.addItem(); @@ -502,6 +512,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @throws UnsupportedOperationException * if the addItem is not supported. */ + @Override public Item addItem(Object itemId) throws UnsupportedOperationException { // Null ids are not accepted @@ -524,6 +535,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @throws UnsupportedOperationException * if the removeAllItems is not supported. */ + @Override public boolean removeAllItems() throws UnsupportedOperationException { final boolean success = container.removeAllItems(); @@ -548,6 +560,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @throws UnsupportedOperationException * if the removeItem is not supported. */ + @Override public boolean removeItem(Object itemId) throws UnsupportedOperationException { @@ -586,6 +599,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @throws UnsupportedOperationException * if the addContainerProperty is not supported. */ + @Override public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { @@ -606,6 +620,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * @throws UnsupportedOperationException * if the removeContainerProperty is not supported. */ + @Override public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { return container.removeContainerProperty(propertyId); @@ -616,6 +631,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * comment here, we use the default documentation from implemented * interface. */ + @Override public boolean containsId(Object itemId) { return container.containsId(itemId); } @@ -624,6 +640,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Gets the specified Item from the container. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public Item getItem(Object itemId) { return container.getItem(itemId); } @@ -633,6 +650,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * comment here, we use the default documentation from implemented * interface. */ + @Override public Collection getItemIds() { return container.getItemIds(); } @@ -642,6 +660,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Container Don't add a JavaDoc comment here, we use the default * documentation from implemented interface. */ + @Override public Property getContainerProperty(Object itemId, Object propertyId) { return container.getContainerProperty(itemId, propertyId); } @@ -651,6 +670,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public Collection getContainerPropertyIds() { return container.getContainerPropertyIds(); } @@ -660,6 +680,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Don't add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public Class getType(Object propertyId) { return container.getType(propertyId); } @@ -668,6 +689,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * Gets the number of Items in the Container. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public int size() { return container.size(); } @@ -677,6 +699,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public void addListener(Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) @@ -689,6 +712,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * comment here, we use the default documentation from implemented * interface. */ + @Override public void removeListener(Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) @@ -701,6 +725,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public void addListener(Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) @@ -713,6 +738,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public void removeListener(Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) @@ -736,6 +762,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, listener = realListener; } + @Override public void containerItemSetChange(ItemSetChangeEvent event) { updateHierarchicalWrapper(); ((Container.ItemSetChangeListener) listener) @@ -743,6 +770,7 @@ public class ContainerHierarchicalWrapper implements Container.Hierarchical, } + @Override public void containerPropertySetChange(PropertySetChangeEvent event) { updateHierarchicalWrapper(); ((Container.PropertySetChangeListener) listener) diff --git a/src/com/vaadin/data/util/ContainerOrderedWrapper.java b/src/com/vaadin/data/util/ContainerOrderedWrapper.java index f333edecf4..d3d6f88d3e 100644 --- a/src/com/vaadin/data/util/ContainerOrderedWrapper.java +++ b/src/com/vaadin/data/util/ContainerOrderedWrapper.java @@ -221,6 +221,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * comment here, we use the default documentation from implemented * interface. */ + @Override public Object firstItemId() { if (ordered) { return ((Container.Ordered) container).firstItemId(); @@ -233,6 +234,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public boolean isFirstId(Object itemId) { if (ordered) { return ((Container.Ordered) container).isFirstId(itemId); @@ -245,6 +247,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public boolean isLastId(Object itemId) { if (ordered) { return ((Container.Ordered) container).isLastId(itemId); @@ -257,6 +260,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * comment here, we use the default documentation from implemented * interface. */ + @Override public Object lastItemId() { if (ordered) { return ((Container.Ordered) container).lastItemId(); @@ -269,6 +273,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * comment here, we use the default documentation from implemented * interface. */ + @Override public Object nextItemId(Object itemId) { if (ordered) { return ((Container.Ordered) container).nextItemId(itemId); @@ -284,6 +289,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public Object prevItemId(Object itemId) { if (ordered) { return ((Container.Ordered) container).prevItemId(itemId); @@ -306,6 +312,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * @return true if the operation succeeded, false * if not */ + @Override public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { @@ -321,6 +328,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * @throws UnsupportedOperationException * if the addItem is not supported. */ + @Override public Object addItem() throws UnsupportedOperationException { final Object id = container.addItem(); @@ -340,6 +348,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * @throws UnsupportedOperationException * if the addItem is not supported. */ + @Override public Item addItem(Object itemId) throws UnsupportedOperationException { final Item item = container.addItem(itemId); if (!ordered && item != null) { @@ -356,6 +365,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * @throws UnsupportedOperationException * if the removeAllItems is not supported. */ + @Override public boolean removeAllItems() throws UnsupportedOperationException { final boolean success = container.removeAllItems(); if (!ordered && success) { @@ -377,6 +387,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * @throws UnsupportedOperationException * if the removeItem is not supported. */ + @Override public boolean removeItem(Object itemId) throws UnsupportedOperationException { @@ -401,6 +412,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * @throws UnsupportedOperationException * if the removeContainerProperty is not supported. */ + @Override public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { return container.removeContainerProperty(propertyId); @@ -411,6 +423,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * comment here, we use the default documentation from implemented * interface. */ + @Override public boolean containsId(Object itemId) { return container.containsId(itemId); } @@ -419,6 +432,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Gets the specified Item from the container. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public Item getItem(Object itemId) { return container.getItem(itemId); } @@ -428,6 +442,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * comment here, we use the default documentation from implemented * interface. */ + @Override public Collection getItemIds() { return container.getItemIds(); } @@ -437,6 +452,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Container Don't add a JavaDoc comment here, we use the default * documentation from implemented interface. */ + @Override public Property getContainerProperty(Object itemId, Object propertyId) { return container.getContainerProperty(itemId, propertyId); } @@ -446,6 +462,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public Collection getContainerPropertyIds() { return container.getContainerPropertyIds(); } @@ -455,6 +472,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Don't add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public Class getType(Object propertyId) { return container.getType(propertyId); } @@ -463,6 +481,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * Gets the number of Items in the Container. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public int size() { int newSize = container.size(); if (lastKnownSize != -1 && newSize != lastKnownSize @@ -480,6 +499,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public void addListener(Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) @@ -492,6 +512,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * comment here, we use the default documentation from implemented * interface. */ + @Override public void removeListener(Container.ItemSetChangeListener listener) { if (container instanceof Container.ItemSetChangeNotifier) { ((Container.ItemSetChangeNotifier) container) @@ -504,6 +525,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public void addListener(Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) @@ -516,6 +538,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public void removeListener(Container.PropertySetChangeListener listener) { if (container instanceof Container.PropertySetChangeNotifier) { ((Container.PropertySetChangeNotifier) container) @@ -529,6 +552,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object, * java.lang.Object) */ + @Override public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException { @@ -553,6 +577,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, * * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) */ + @Override public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException { @@ -588,6 +613,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, listener = realListener; } + @Override public void containerItemSetChange(ItemSetChangeEvent event) { updateOrderWrapper(); ((Container.ItemSetChangeListener) listener) @@ -595,6 +621,7 @@ public class ContainerOrderedWrapper implements Container.Ordered, } + @Override public void containerPropertySetChange(PropertySetChangeEvent event) { updateOrderWrapper(); ((Container.PropertySetChangeListener) listener) diff --git a/src/com/vaadin/data/util/DefaultItemSorter.java b/src/com/vaadin/data/util/DefaultItemSorter.java index 47db5d7507..81b15ebd4f 100644 --- a/src/com/vaadin/data/util/DefaultItemSorter.java +++ b/src/com/vaadin/data/util/DefaultItemSorter.java @@ -61,6 +61,7 @@ public class DefaultItemSorter implements ItemSorter { * @see com.vaadin.data.util.ItemSorter#compare(java.lang.Object, * java.lang.Object) */ + @Override public int compare(Object o1, Object o2) { Item item1 = container.getItem(o1); Item item2 = container.getItem(o2); @@ -147,6 +148,7 @@ public class DefaultItemSorter implements ItemSorter { * com.vaadin.data.util.ItemSorter#setSortProperties(com.vaadin.data.Container * .Sortable, java.lang.Object[], boolean[]) */ + @Override public void setSortProperties(Container.Sortable container, Object[] propertyId, boolean[] ascending) { this.container = container; @@ -181,6 +183,7 @@ public class DefaultItemSorter implements ItemSorter { public static class DefaultPropertyValueComparator implements Comparator, Serializable { + @Override @SuppressWarnings("unchecked") public int compare(Object o1, Object o2) { int r = 0; diff --git a/src/com/vaadin/data/util/FilesystemContainer.java b/src/com/vaadin/data/util/FilesystemContainer.java index 7100286712..cdfeb57e14 100644 --- a/src/com/vaadin/data/util/FilesystemContainer.java +++ b/src/com/vaadin/data/util/FilesystemContainer.java @@ -187,6 +187,7 @@ public class FilesystemContainer implements Container.Hierarchical { * @return true if the specified Item is a directory, * false otherwise. */ + @Override public boolean areChildrenAllowed(Object itemId) { return itemId instanceof File && ((File) itemId).canRead() && ((File) itemId).isDirectory(); @@ -197,6 +198,7 @@ public class FilesystemContainer implements Container.Hierarchical { * add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public Collection getChildren(Object itemId) { if (!(itemId instanceof File)) { @@ -223,6 +225,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the parent item of the specified Item. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public Object getParent(Object itemId) { if (!(itemId instanceof File)) { @@ -235,6 +238,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Tests if the specified Item has any children. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public boolean hasChildren(Object itemId) { if (!(itemId instanceof File)) { @@ -254,6 +258,7 @@ public class FilesystemContainer implements Container.Hierarchical { * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public boolean isRoot(Object itemId) { if (!(itemId instanceof File)) { @@ -272,6 +277,7 @@ public class FilesystemContainer implements Container.Hierarchical { * comment here, we use the default documentation from implemented * interface. */ + @Override public Collection rootItemIds() { File[] f; @@ -311,6 +317,7 @@ public class FilesystemContainer implements Container.Hierarchical { * @throws UnsupportedOperationException * if the setChildrenAllowed is not supported. */ + @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { @@ -332,6 +339,7 @@ public class FilesystemContainer implements Container.Hierarchical { * @throws UnsupportedOperationException * if the setParent is not supported. */ + @Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { @@ -343,6 +351,7 @@ public class FilesystemContainer implements Container.Hierarchical { * comment here, we use the default documentation from implemented * interface. */ + @Override public boolean containsId(Object itemId) { if (!(itemId instanceof File)) { @@ -371,6 +380,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the specified Item from the filesystem. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public Item getItem(Object itemId) { if (!(itemId instanceof File)) { @@ -416,6 +426,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the IDs of Items in the filesystem. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public Collection getItemIds() { if (recursive) { @@ -459,6 +470,7 @@ public class FilesystemContainer implements Container.Hierarchical { * the property's ID. * @return the requested property's value, or null */ + @Override public Property getContainerProperty(Object itemId, Object propertyId) { if (!(itemId instanceof File)) { @@ -493,6 +505,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @return Unmodifiable collection containing all available file properties. */ + @Override public Collection getContainerPropertyIds() { return FILE_PROPERTIES; } @@ -506,6 +519,7 @@ public class FilesystemContainer implements Container.Hierarchical { * the ID of the property whose type is requested. * @return data type of the requested property, or null */ + @Override public Class getType(Object propertyId) { if (propertyId.equals(PROPERTY_NAME)) { @@ -556,6 +570,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @return Number of Items in the container. */ + @Override public int size() { if (recursive) { @@ -609,6 +624,7 @@ public class FilesystemContainer implements Container.Hierarchical { * Gets the specified property of this file. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public Property getItemProperty(Object id) { return getContainerProperty(file, id); } @@ -618,6 +634,7 @@ public class FilesystemContainer implements Container.Hierarchical { * JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public Collection getItemPropertyIds() { return getContainerPropertyIds(); } @@ -716,6 +733,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see com.vaadin.data.Item#addItemProperty(Object, Property) */ + @Override public boolean addItemProperty(Object id, Property property) throws UnsupportedOperationException { throw new UnsupportedOperationException("Filesystem container " @@ -727,6 +745,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see com.vaadin.data.Item#removeItemProperty(Object) */ + @Override public boolean removeItemProperty(Object id) throws UnsupportedOperationException { throw new UnsupportedOperationException( @@ -763,6 +782,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see java.io.FilenameFilter#accept(File, String) */ + @Override public boolean accept(File dir, String name) { if (name.endsWith(filter)) { return true; @@ -832,6 +852,7 @@ public class FilesystemContainer implements Container.Hierarchical { * @see com.vaadin.data.Container#addContainerProperty(java.lang.Object, * java.lang.Class, java.lang.Object) */ + @Override public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { throw new UnsupportedOperationException( @@ -843,6 +864,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see com.vaadin.data.Container#addItem() */ + @Override public Object addItem() throws UnsupportedOperationException { throw new UnsupportedOperationException( "File system container does not support this operation"); @@ -853,6 +875,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see com.vaadin.data.Container#addItem(java.lang.Object) */ + @Override public Item addItem(Object itemId) throws UnsupportedOperationException { throw new UnsupportedOperationException( "File system container does not support this operation"); @@ -863,6 +886,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see com.vaadin.data.Container#removeAllItems() */ + @Override public boolean removeAllItems() throws UnsupportedOperationException { throw new UnsupportedOperationException( "File system container does not support this operation"); @@ -873,6 +897,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ + @Override public boolean removeItem(Object itemId) throws UnsupportedOperationException { throw new UnsupportedOperationException( @@ -884,6 +909,7 @@ public class FilesystemContainer implements Container.Hierarchical { * * @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object ) */ + @Override public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { throw new UnsupportedOperationException( diff --git a/src/com/vaadin/data/util/HierarchicalContainer.java b/src/com/vaadin/data/util/HierarchicalContainer.java index 1291c8fcc4..06ab77c0e7 100644 --- a/src/com/vaadin/data/util/HierarchicalContainer.java +++ b/src/com/vaadin/data/util/HierarchicalContainer.java @@ -77,6 +77,7 @@ public class HierarchicalContainer extends IndexedContainer implements * Can the specified Item have any children? Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public boolean areChildrenAllowed(Object itemId) { if (noChildrenAllowed.contains(itemId)) { return false; @@ -89,6 +90,7 @@ public class HierarchicalContainer extends IndexedContainer implements * comment here, we use the default documentation from implemented * interface. */ + @Override public Collection getChildren(Object itemId) { LinkedList c; @@ -109,6 +111,7 @@ public class HierarchicalContainer extends IndexedContainer implements * comment here, we use the default documentation from implemented * interface. */ + @Override public Object getParent(Object itemId) { if (filteredParent != null) { return filteredParent.get(itemId); @@ -121,6 +124,7 @@ public class HierarchicalContainer extends IndexedContainer implements * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public boolean hasChildren(Object itemId) { if (filteredChildren != null) { return filteredChildren.containsKey(itemId); @@ -134,6 +138,7 @@ public class HierarchicalContainer extends IndexedContainer implements * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public boolean isRoot(Object itemId) { // If the container is filtered the itemId must be among filteredRoots // to be a root. @@ -156,6 +161,7 @@ public class HierarchicalContainer extends IndexedContainer implements * comment here, we use the default documentation from implemented * interface. */ + @Override public Collection rootItemIds() { if (filteredRoots != null) { return Collections.unmodifiableCollection(filteredRoots); @@ -183,6 +189,7 @@ public class HierarchicalContainer extends IndexedContainer implements * @return true if the operation succeeded, false * if not */ + @Override public boolean setChildrenAllowed(Object itemId, boolean childrenAllowed) { // Checks that the item is in the container @@ -217,6 +224,7 @@ public class HierarchicalContainer extends IndexedContainer implements * @return true if the operation succeeded, false * if not */ + @Override public boolean setParent(Object itemId, Object newParentId) { // Checks that the item is in the container diff --git a/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java b/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java index b7eac3e378..172dc0dd4f 100644 --- a/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java +++ b/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java @@ -25,35 +25,43 @@ public class HierarchicalContainerOrderedWrapper extends hierarchical = toBeWrapped; } + @Override public boolean areChildrenAllowed(Object itemId) { return hierarchical.areChildrenAllowed(itemId); } + @Override public Collection getChildren(Object itemId) { return hierarchical.getChildren(itemId); } + @Override public Object getParent(Object itemId) { return hierarchical.getParent(itemId); } + @Override public boolean hasChildren(Object itemId) { return hierarchical.hasChildren(itemId); } + @Override public boolean isRoot(Object itemId) { return hierarchical.isRoot(itemId); } + @Override public Collection rootItemIds() { return hierarchical.rootItemIds(); } + @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { return hierarchical.setChildrenAllowed(itemId, areChildrenAllowed); } + @Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { return hierarchical.setParent(itemId, newParentId); diff --git a/src/com/vaadin/data/util/IndexedContainer.java b/src/com/vaadin/data/util/IndexedContainer.java index bcaa5eda42..b95b2c4de8 100644 --- a/src/com/vaadin/data/util/IndexedContainer.java +++ b/src/com/vaadin/data/util/IndexedContainer.java @@ -128,6 +128,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Container#getContainerPropertyIds() */ + @Override public Collection getContainerPropertyIds() { return Collections.unmodifiableCollection(propertyIds); } @@ -139,6 +140,7 @@ public class IndexedContainer extends * the ID of the Property. * @return Type of the requested Property */ + @Override public Class getType(Object propertyId) { return types.get(propertyId); } @@ -149,6 +151,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Container#getContainerProperty(java.lang.Object, * java.lang.Object) */ + @Override public Property getContainerProperty(Object itemId, Object propertyId) { if (!containsId(itemId)) { return null; @@ -466,6 +469,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Property.ValueChangeEvent#getProperty() */ + @Override public Property getProperty() { return (Property) getSource(); } @@ -488,6 +492,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Property.ValueChangeNotifier#addListener(com. * vaadin.data.Property.ValueChangeListener) */ + @Override public void addListener(Property.ValueChangeListener listener) { if (propertyValueChangeListeners == null) { propertyValueChangeListeners = new LinkedList(); @@ -501,6 +506,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Property.ValueChangeNotifier#removeListener(com * .vaadin.data.Property.ValueChangeListener) */ + @Override public void removeListener(Property.ValueChangeListener listener) { if (propertyValueChangeListeners != null) { propertyValueChangeListeners.remove(listener); @@ -679,10 +685,12 @@ public class IndexedContainer extends * * @see com.vaadin.data.Item#getItemProperty(java.lang.Object) */ + @Override public Property getItemProperty(Object id) { return new IndexedContainerProperty(itemId, id); } + @Override public Collection getItemPropertyIds() { return Collections.unmodifiableCollection(propertyIds); } @@ -753,6 +761,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Item#addProperty(Object, Property) */ + @Override public boolean addItemProperty(Object id, Property property) throws UnsupportedOperationException { throw new UnsupportedOperationException("Indexed container item " @@ -766,6 +775,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Item#removeProperty(Object) */ + @Override public boolean removeItemProperty(Object id) throws UnsupportedOperationException { throw new UnsupportedOperationException( @@ -824,6 +834,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Property#getType() */ + @Override public Class getType() { return types.get(propertyId); } @@ -833,6 +844,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Property#getValue() */ + @Override public Object getValue() { return items.get(itemId).get(propertyId); } @@ -842,6 +854,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Property#isReadOnly() */ + @Override public boolean isReadOnly() { return readOnlyProperties.contains(this); } @@ -851,6 +864,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Property#setReadOnly(boolean) */ + @Override public void setReadOnly(boolean newStatus) { if (newStatus) { readOnlyProperties.add(this); @@ -864,6 +878,7 @@ public class IndexedContainer extends * * @see com.vaadin.data.Property#setValue(java.lang.Object) */ + @Override public void setValue(Object newValue) throws Property.ReadOnlyException { // Gets the Property set final Map propertySet = items.get(itemId); @@ -946,6 +961,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Property.ValueChangeNotifier#addListener( * com.vaadin.data.Property.ValueChangeListener) */ + @Override public void addListener(Property.ValueChangeListener listener) { addSinglePropertyChangeListener(propertyId, itemId, listener); } @@ -956,6 +972,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Property.ValueChangeNotifier#removeListener * (com.vaadin.data.Property.ValueChangeListener) */ + @Override public void removeListener(Property.ValueChangeListener listener) { removeSinglePropertyChangeListener(propertyId, itemId, listener); } @@ -972,6 +989,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[], * boolean[]) */ + @Override public void sort(Object[] propertyId, boolean[] ascending) { sortContainer(propertyId, ascending); } @@ -982,6 +1000,7 @@ public class IndexedContainer extends * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds * () */ + @Override public Collection getSortableContainerPropertyIds() { return getSortablePropertyIds(); } @@ -1054,6 +1073,7 @@ public class IndexedContainer extends return nc; } + @Override public void addContainerFilter(Object propertyId, String filterString, boolean ignoreCase, boolean onlyMatchPrefix) { try { @@ -1065,19 +1085,23 @@ public class IndexedContainer extends } } + @Override public void removeAllContainerFilters() { removeAllFilters(); } + @Override public void removeContainerFilters(Object propertyId) { removeFilters(propertyId); } + @Override public void addContainerFilter(Filter filter) throws UnsupportedFilterException { addFilter(filter); } + @Override public void removeContainerFilter(Filter filter) { removeFilter(filter); } diff --git a/src/com/vaadin/data/util/ItemSorter.java b/src/com/vaadin/data/util/ItemSorter.java index 7f9e3a3f13..4399dbe292 100644 --- a/src/com/vaadin/data/util/ItemSorter.java +++ b/src/com/vaadin/data/util/ItemSorter.java @@ -51,6 +51,7 @@ public interface ItemSorter extends Comparator, Cloneable, Serializable * * @see Comparator#compare(Object, Object) */ + @Override int compare(Object itemId1, Object itemId2); } diff --git a/src/com/vaadin/data/util/MethodProperty.java b/src/com/vaadin/data/util/MethodProperty.java index 7df45e04ab..0c64d90481 100644 --- a/src/com/vaadin/data/util/MethodProperty.java +++ b/src/com/vaadin/data/util/MethodProperty.java @@ -568,6 +568,7 @@ public class MethodProperty extends AbstractProperty { * * @return type of the Property */ + @Override public final Class getType() { return type; } @@ -591,6 +592,7 @@ public class MethodProperty extends AbstractProperty { * * @return the value of the Property */ + @Override public T getValue() { try { return (T) getMethod.invoke(instance, getArgs); @@ -638,6 +640,7 @@ public class MethodProperty extends AbstractProperty { * read-only mode. * @see #invokeSetMethod(Object) */ + @Override @SuppressWarnings("unchecked") public void setValue(Object newValue) throws Property.ReadOnlyException { diff --git a/src/com/vaadin/data/util/MethodPropertyDescriptor.java b/src/com/vaadin/data/util/MethodPropertyDescriptor.java index 5fdb982b9e..a2a76ec6cf 100644 --- a/src/com/vaadin/data/util/MethodPropertyDescriptor.java +++ b/src/com/vaadin/data/util/MethodPropertyDescriptor.java @@ -112,14 +112,17 @@ public class MethodPropertyDescriptor implements } }; + @Override public String getName() { return name; } + @Override public Class getPropertyType() { return propertyType; } + @Override public Property createProperty(Object bean) { return new MethodProperty(propertyType, bean, readMethod, writeMethod); diff --git a/src/com/vaadin/data/util/NestedMethodProperty.java b/src/com/vaadin/data/util/NestedMethodProperty.java index d7b0f44912..9bff38456d 100644 --- a/src/com/vaadin/data/util/NestedMethodProperty.java +++ b/src/com/vaadin/data/util/NestedMethodProperty.java @@ -165,6 +165,7 @@ public class NestedMethodProperty extends AbstractProperty { this.setMethod = setMethod; } + @Override public Class getType() { return type; } @@ -180,6 +181,7 @@ public class NestedMethodProperty extends AbstractProperty { * * @return the value of the Property */ + @Override public T getValue() { try { Object object = instance; @@ -202,6 +204,7 @@ public class NestedMethodProperty extends AbstractProperty { * read-only mode. * @see #invokeSetMethod(Object) */ + @Override public void setValue(Object newValue) throws ReadOnlyException { // Checks the mode if (isReadOnly()) { diff --git a/src/com/vaadin/data/util/NestedPropertyDescriptor.java b/src/com/vaadin/data/util/NestedPropertyDescriptor.java index 6404f6361d..b67b425d1d 100644 --- a/src/com/vaadin/data/util/NestedPropertyDescriptor.java +++ b/src/com/vaadin/data/util/NestedPropertyDescriptor.java @@ -42,14 +42,17 @@ public class NestedPropertyDescriptor implements this.propertyType = property.getType(); } + @Override public String getName() { return name; } + @Override public Class getPropertyType() { return propertyType; } + @Override public Property createProperty(BT bean) { return new NestedMethodProperty(bean, name); } diff --git a/src/com/vaadin/data/util/ObjectProperty.java b/src/com/vaadin/data/util/ObjectProperty.java index 9c60b9146e..cb85b44c2a 100644 --- a/src/com/vaadin/data/util/ObjectProperty.java +++ b/src/com/vaadin/data/util/ObjectProperty.java @@ -91,6 +91,7 @@ public class ObjectProperty extends AbstractProperty { * * @return type of the Property */ + @Override public final Class getType() { return type; } @@ -100,6 +101,7 @@ public class ObjectProperty extends AbstractProperty { * * @return the value stored in the Property */ + @Override public T getValue() { return value; } @@ -115,6 +117,7 @@ public class ObjectProperty extends AbstractProperty { * @throws Property.ReadOnlyException if the object is in * read-only mode */ + @Override @SuppressWarnings("unchecked") public void setValue(Object newValue) throws Property.ReadOnlyException { diff --git a/src/com/vaadin/data/util/PropertyFormatter.java b/src/com/vaadin/data/util/PropertyFormatter.java index a63973535b..3d65726309 100644 --- a/src/com/vaadin/data/util/PropertyFormatter.java +++ b/src/com/vaadin/data/util/PropertyFormatter.java @@ -75,6 +75,7 @@ public abstract class PropertyFormatter extends AbstractProperty * @return the current data source as a Property, or null if * none defined. */ + @Override public Property getPropertyDataSource() { return dataSource; } @@ -91,6 +92,7 @@ public abstract class PropertyFormatter extends AbstractProperty * @param newDataSource * the new data source Property. */ + @Override public void setPropertyDataSource(Property newDataSource) { boolean readOnly = false; @@ -132,6 +134,7 @@ public abstract class PropertyFormatter extends AbstractProperty } /* Documented in the interface */ + @Override public Class getType() { return String.class; } @@ -142,6 +145,7 @@ public abstract class PropertyFormatter extends AbstractProperty * @return If the datasource returns null, this is null. Otherwise this is * String given by format(). */ + @Override public String getValue() { T value = dataSource == null ? null : dataSource.getValue(); if (value == null) { @@ -195,6 +199,7 @@ public abstract class PropertyFormatter extends AbstractProperty } } + @Override public void setValue(Object newValue) throws ReadOnlyException { if (dataSource == null) { return; @@ -221,6 +226,7 @@ public abstract class PropertyFormatter extends AbstractProperty * * This should not be called directly. */ + @Override public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { fireValueChange(); } @@ -230,6 +236,7 @@ public abstract class PropertyFormatter extends AbstractProperty * * This should not be called directly. */ + @Override public void readOnlyStatusChange( com.vaadin.data.Property.ReadOnlyStatusChangeEvent event) { fireReadOnlyStatusChange(); diff --git a/src/com/vaadin/data/util/PropertysetItem.java b/src/com/vaadin/data/util/PropertysetItem.java index 3270fa31f9..22f2da75b2 100644 --- a/src/com/vaadin/data/util/PropertysetItem.java +++ b/src/com/vaadin/data/util/PropertysetItem.java @@ -57,6 +57,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * the identifier of the Property to get. * @return the Property with the given ID or null */ + @Override public Property getItemProperty(Object id) { return map.get(id); } @@ -67,6 +68,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * @return unmodifiable collection containing IDs of the Properties stored * the Item */ + @Override public Collection getItemPropertyIds() { return Collections.unmodifiableCollection(list); } @@ -83,6 +85,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * @return true if the operation succeeded false * if not */ + @Override public boolean removeItemProperty(Object id) { // Cant remove missing properties @@ -107,6 +110,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * @return true if the operation succeeded, false * if not */ + @Override public boolean addItemProperty(Object id, Property property) { // Null ids are not accepted @@ -175,6 +179,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * * @return source object of the event as an Item */ + @Override public Item getItem() { return (Item) getSource(); } @@ -186,6 +191,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * @param listener * the new Listener to be registered. */ + @Override public void addListener(Item.PropertySetChangeListener listener) { if (propertySetChangeListeners == null) { propertySetChangeListeners = new LinkedList(); @@ -199,6 +205,7 @@ public class PropertysetItem implements Item, Item.PropertySetChangeNotifier, * @param listener * the Listener to be removed. */ + @Override public void removeListener(Item.PropertySetChangeListener listener) { if (propertySetChangeListeners != null) { propertySetChangeListeners.remove(listener); diff --git a/src/com/vaadin/data/util/QueryContainer.java b/src/com/vaadin/data/util/QueryContainer.java index 7fef63e7f1..dc7c883a7e 100644 --- a/src/com/vaadin/data/util/QueryContainer.java +++ b/src/com/vaadin/data/util/QueryContainer.java @@ -188,6 +188,7 @@ public class QueryContainer implements Container, Container.Ordered, * @return Item Id. */ + @Override public Item getItem(Object id) { return new Row(id); } @@ -198,6 +199,7 @@ public class QueryContainer implements Container, Container.Ordered, * @return Collection of Property ID. */ + @Override public Collection getContainerPropertyIds() { return propertyIds; } @@ -207,6 +209,7 @@ public class QueryContainer implements Container, Container.Ordered, * * @return collection of Item IDs */ + @Override public Collection getItemIds() { final Collection c = new ArrayList(size); for (int i = 1; i <= size; i++) { @@ -229,6 +232,7 @@ public class QueryContainer implements Container, Container.Ordered, * otherwise. */ + @Override public synchronized Property getContainerProperty(Object itemId, Object propertyId) { if (!(itemId instanceof Integer && propertyId instanceof String)) { @@ -256,6 +260,7 @@ public class QueryContainer implements Container, Container.Ordered, * @return data type of the Properties */ + @Override public Class getType(Object id) { return propertyTypes.get(id); } @@ -265,6 +270,7 @@ public class QueryContainer implements Container, Container.Ordered, * * @return the number of items in the container. */ + @Override public int size() { return size; } @@ -277,6 +283,7 @@ public class QueryContainer implements Container, Container.Ordered, * @return true if given id is in the container; * false otherwise. */ + @Override public boolean containsId(Object id) { if (!(id instanceof Integer)) { return false; @@ -302,6 +309,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the addItem method is not supported. */ + @Override public Item addItem(Object itemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @@ -313,6 +321,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the addItem method is not supported. */ + @Override public Object addItem() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @@ -327,6 +336,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the removeItem method is not supported. */ + @Override public boolean removeItem(Object itemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -346,6 +356,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the addContainerProperty method is not supported. */ + @Override public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -361,6 +372,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the removeContainerProperty method is not supported. */ + @Override public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -374,6 +386,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the removeAllItems method is not supported. */ + @Override public boolean removeAllItems() throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @@ -389,6 +402,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the addItemAfter method is not supported. */ + @Override public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -404,6 +418,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the addItemAfter method is not supported. */ + @Override public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -414,6 +429,7 @@ public class QueryContainer implements Container, Container.Ordered, * * @return ID of the first Item in the list. */ + @Override public Object firstItemId() { if (size < 1) { return null; @@ -427,6 +443,7 @@ public class QueryContainer implements Container, Container.Ordered, * @param id * ID of an Item in the Container. */ + @Override public boolean isFirstId(Object id) { return size > 0 && (id instanceof Integer) && ((Integer) id).intValue() == 1; @@ -439,6 +456,7 @@ public class QueryContainer implements Container, Container.Ordered, * ID of an Item in the Container * */ + @Override public boolean isLastId(Object id) { return size > 0 && (id instanceof Integer) && ((Integer) id).intValue() == size; @@ -449,6 +467,7 @@ public class QueryContainer implements Container, Container.Ordered, * * @return ID of the last Item. */ + @Override public Object lastItemId() { if (size < 1) { return null; @@ -463,6 +482,7 @@ public class QueryContainer implements Container, Container.Ordered, * ID of an Item in the Container. * @return ID of the next Item or null. */ + @Override public Object nextItemId(Object id) { if (size < 1 || !(id instanceof Integer)) { return null; @@ -481,6 +501,7 @@ public class QueryContainer implements Container, Container.Ordered, * ID of an Item in the Container. * @return ID of the previous Item or null. */ + @Override public Object prevItemId(Object id) { if (size < 1 || !(id instanceof Integer)) { return null; @@ -519,6 +540,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the addItemProperty method is not supported. */ + @Override public boolean addItemProperty(Object id, Property property) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -532,6 +554,7 @@ public class QueryContainer implements Container, Container.Ordered, * identifier of the Property to get * @return the Property with the given ID or null */ + @Override public Property getItemProperty(Object propertyId) { return getContainerProperty(id, propertyId); } @@ -542,6 +565,7 @@ public class QueryContainer implements Container, Container.Ordered, * @return unmodifiable collection containing IDs of the Properties * stored the Item. */ + @Override public Collection getItemPropertyIds() { return propertyIds; } @@ -556,6 +580,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the removeItemProperty is not supported. */ + @Override public boolean removeItemProperty(Object id) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -588,6 +613,7 @@ public class QueryContainer implements Container, Container.Ordered, * @throws UnsupportedOperationException * if the addItemAt is not supported. */ + @Override public Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -605,6 +631,7 @@ public class QueryContainer implements Container, Container.Ordered, * if the addItemAt is not supported. */ + @Override public Object addItemAt(int index) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @@ -616,6 +643,7 @@ public class QueryContainer implements Container, Container.Ordered, * Index Id. * @return ID in the given index. */ + @Override public Object getIdByIndex(int index) { if (size < 1 || index < 0 || index >= size) { return null; @@ -632,6 +660,7 @@ public class QueryContainer implements Container, Container.Ordered, * Item */ + @Override public int indexOfId(Object id) { if (size < 1 || !(id instanceof Integer)) { return -1; diff --git a/src/com/vaadin/data/util/TextFileProperty.java b/src/com/vaadin/data/util/TextFileProperty.java index 5ebba98062..598b721a9c 100644 --- a/src/com/vaadin/data/util/TextFileProperty.java +++ b/src/com/vaadin/data/util/TextFileProperty.java @@ -64,6 +64,7 @@ public class TextFileProperty extends AbstractProperty { * * @see com.vaadin.data.Property#getType() */ + @Override public Class getType() { return String.class; } @@ -73,6 +74,7 @@ public class TextFileProperty extends AbstractProperty { * * @see com.vaadin.data.Property#getValue() */ + @Override public String getValue() { if (file == null) { return null; @@ -114,6 +116,7 @@ public class TextFileProperty extends AbstractProperty { * * @see com.vaadin.data.Property#setValue(java.lang.Object) */ + @Override public void setValue(Object newValue) throws ReadOnlyException { if (isReadOnly()) { throw new ReadOnlyException(); diff --git a/src/com/vaadin/data/util/TransactionalPropertyWrapper.java b/src/com/vaadin/data/util/TransactionalPropertyWrapper.java index 06ec0935c3..d042bfaac2 100644 --- a/src/com/vaadin/data/util/TransactionalPropertyWrapper.java +++ b/src/com/vaadin/data/util/TransactionalPropertyWrapper.java @@ -44,6 +44,7 @@ public class TransactionalPropertyWrapper extends AbstractProperty ((ValueChangeNotifier) wrappedProperty) .addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { fireValueChange(); } @@ -51,29 +52,35 @@ public class TransactionalPropertyWrapper extends AbstractProperty } } + @Override public Class getType() { return wrappedProperty.getType(); } + @Override public T getValue() { return wrappedProperty.getValue(); } + @Override public void setValue(Object newValue) throws ReadOnlyException { // Causes a value change to be sent to this listener which in turn fires // a new value change event for this property wrappedProperty.setValue(newValue); } + @Override public void startTransaction() { inTransaction = true; valueBeforeTransaction = getValue(); } + @Override public void commit() { endTransaction(); } + @Override public void rollback() { try { wrappedProperty.setValue(valueBeforeTransaction); diff --git a/src/com/vaadin/data/util/converter/DateToLongConverter.java b/src/com/vaadin/data/util/converter/DateToLongConverter.java index 537800f617..aeba38aa1f 100644 --- a/src/com/vaadin/data/util/converter/DateToLongConverter.java +++ b/src/com/vaadin/data/util/converter/DateToLongConverter.java @@ -24,6 +24,7 @@ public class DateToLongConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.util.Locale) */ + @Override public Long convertToModel(Date value, Locale locale) { if (value == null) { return null; @@ -39,6 +40,7 @@ public class DateToLongConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) */ + @Override public Date convertToPresentation(Long value, Locale locale) { if (value == null) { return null; @@ -52,6 +54,7 @@ public class DateToLongConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getModelType() */ + @Override public Class getModelType() { return Long.class; } @@ -61,6 +64,7 @@ public class DateToLongConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ + @Override public Class getPresentationType() { return Date.class; } diff --git a/src/com/vaadin/data/util/converter/DefaultConverterFactory.java b/src/com/vaadin/data/util/converter/DefaultConverterFactory.java index 3ad7b6a85b..afb95d81ed 100644 --- a/src/com/vaadin/data/util/converter/DefaultConverterFactory.java +++ b/src/com/vaadin/data/util/converter/DefaultConverterFactory.java @@ -27,6 +27,7 @@ public class DefaultConverterFactory implements ConverterFactory { private final static Logger log = Logger .getLogger(DefaultConverterFactory.class.getName()); + @Override public Converter createConverter( Class presentationType, Class modelType) { Converter converter = findConverter( diff --git a/src/com/vaadin/data/util/converter/ReverseConverter.java b/src/com/vaadin/data/util/converter/ReverseConverter.java index 1c561f29e8..fa1bb5daf1 100644 --- a/src/com/vaadin/data/util/converter/ReverseConverter.java +++ b/src/com/vaadin/data/util/converter/ReverseConverter.java @@ -42,6 +42,7 @@ public class ReverseConverter implements * @see com.vaadin.data.util.converter.Converter#convertToModel(java * .lang.Object, java.util.Locale) */ + @Override public MODEL convertToModel(PRESENTATION value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { return realConverter.convertToPresentation(value, locale); @@ -54,6 +55,7 @@ public class ReverseConverter implements * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) */ + @Override public PRESENTATION convertToPresentation(MODEL value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { return realConverter.convertToModel(value, locale); @@ -64,6 +66,7 @@ public class ReverseConverter implements * * @see com.vaadin.data.util.converter.Converter#getSourceType() */ + @Override public Class getModelType() { return realConverter.getPresentationType(); } @@ -73,6 +76,7 @@ public class ReverseConverter implements * * @see com.vaadin.data.util.converter.Converter#getTargetType() */ + @Override public Class getPresentationType() { return realConverter.getModelType(); } diff --git a/src/com/vaadin/data/util/converter/StringToBooleanConverter.java b/src/com/vaadin/data/util/converter/StringToBooleanConverter.java index 96a3a3d071..999f575dc4 100644 --- a/src/com/vaadin/data/util/converter/StringToBooleanConverter.java +++ b/src/com/vaadin/data/util/converter/StringToBooleanConverter.java @@ -27,6 +27,7 @@ public class StringToBooleanConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.util.Locale) */ + @Override public Boolean convertToModel(String value, Locale locale) throws ConversionException { if (value == null) { @@ -71,6 +72,7 @@ public class StringToBooleanConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) */ + @Override public String convertToPresentation(Boolean value, Locale locale) throws ConversionException { if (value == null) { @@ -88,6 +90,7 @@ public class StringToBooleanConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getModelType() */ + @Override public Class getModelType() { return Boolean.class; } @@ -97,6 +100,7 @@ public class StringToBooleanConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ + @Override public Class getPresentationType() { return String.class; } diff --git a/src/com/vaadin/data/util/converter/StringToDateConverter.java b/src/com/vaadin/data/util/converter/StringToDateConverter.java index 6f3c2e47f6..487b02b2aa 100644 --- a/src/com/vaadin/data/util/converter/StringToDateConverter.java +++ b/src/com/vaadin/data/util/converter/StringToDateConverter.java @@ -52,6 +52,7 @@ public class StringToDateConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.util.Locale) */ + @Override public Date convertToModel(String value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { if (value == null) { @@ -78,6 +79,7 @@ public class StringToDateConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) */ + @Override public String convertToPresentation(Date value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { if (value == null) { @@ -92,6 +94,7 @@ public class StringToDateConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getModelType() */ + @Override public Class getModelType() { return Date.class; } @@ -101,6 +104,7 @@ public class StringToDateConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ + @Override public Class getPresentationType() { return String.class; } diff --git a/src/com/vaadin/data/util/converter/StringToDoubleConverter.java b/src/com/vaadin/data/util/converter/StringToDoubleConverter.java index 60a38f4127..251f91855b 100644 --- a/src/com/vaadin/data/util/converter/StringToDoubleConverter.java +++ b/src/com/vaadin/data/util/converter/StringToDoubleConverter.java @@ -49,6 +49,7 @@ public class StringToDoubleConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.util.Locale) */ + @Override public Double convertToModel(String value, Locale locale) throws ConversionException { if (value == null) { @@ -74,6 +75,7 @@ public class StringToDoubleConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) */ + @Override public String convertToPresentation(Double value, Locale locale) throws ConversionException { if (value == null) { @@ -88,6 +90,7 @@ public class StringToDoubleConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getModelType() */ + @Override public Class getModelType() { return Double.class; } @@ -97,6 +100,7 @@ public class StringToDoubleConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ + @Override public Class getPresentationType() { return String.class; } diff --git a/src/com/vaadin/data/util/converter/StringToIntegerConverter.java b/src/com/vaadin/data/util/converter/StringToIntegerConverter.java index e55feec3b6..950f01c6ab 100644 --- a/src/com/vaadin/data/util/converter/StringToIntegerConverter.java +++ b/src/com/vaadin/data/util/converter/StringToIntegerConverter.java @@ -39,6 +39,7 @@ public class StringToIntegerConverter implements Converter { return NumberFormat.getIntegerInstance(locale); } + @Override public Integer convertToModel(String value, Locale locale) throws ConversionException { if (value == null) { @@ -64,6 +65,7 @@ public class StringToIntegerConverter implements Converter { return parsedValue.intValue(); } + @Override public String convertToPresentation(Integer value, Locale locale) throws ConversionException { if (value == null) { @@ -73,10 +75,12 @@ public class StringToIntegerConverter implements Converter { return getFormat(locale).format(value); } + @Override public Class getModelType() { return Integer.class; } + @Override public Class getPresentationType() { return String.class; } diff --git a/src/com/vaadin/data/util/converter/StringToNumberConverter.java b/src/com/vaadin/data/util/converter/StringToNumberConverter.java index d1816007e7..42699a326a 100644 --- a/src/com/vaadin/data/util/converter/StringToNumberConverter.java +++ b/src/com/vaadin/data/util/converter/StringToNumberConverter.java @@ -45,6 +45,7 @@ public class StringToNumberConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToModel(java.lang.Object, * java.util.Locale) */ + @Override public Number convertToModel(String value, Locale locale) throws ConversionException { if (value == null) { @@ -77,6 +78,7 @@ public class StringToNumberConverter implements Converter { * com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang * .Object, java.util.Locale) */ + @Override public String convertToPresentation(Number value, Locale locale) throws ConversionException { if (value == null) { @@ -91,6 +93,7 @@ public class StringToNumberConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getModelType() */ + @Override public Class getModelType() { return Number.class; } @@ -100,6 +103,7 @@ public class StringToNumberConverter implements Converter { * * @see com.vaadin.data.util.converter.Converter#getPresentationType() */ + @Override public Class getPresentationType() { return String.class; } diff --git a/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java b/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java index 0f20e28586..482b10120c 100644 --- a/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java +++ b/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java @@ -45,6 +45,7 @@ public abstract class AbstractJunctionFilter implements Filter { * If there are no sub-filters, false is returned - override in subclasses * to change this behavior. */ + @Override public boolean appliesToProperty(Object propertyId) { for (Filter filter : getFilters()) { if (filter.appliesToProperty(propertyId)) { diff --git a/src/com/vaadin/data/util/filter/And.java b/src/com/vaadin/data/util/filter/And.java index 08182794a8..ca6c35aba7 100644 --- a/src/com/vaadin/data/util/filter/And.java +++ b/src/com/vaadin/data/util/filter/And.java @@ -30,6 +30,7 @@ public final class And extends AbstractJunctionFilter { super(filters); } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedFilterException { for (Filter filter : getFilters()) { diff --git a/src/com/vaadin/data/util/filter/Between.java b/src/com/vaadin/data/util/filter/Between.java index dd47d36c7f..b00a74d13d 100644 --- a/src/com/vaadin/data/util/filter/Between.java +++ b/src/com/vaadin/data/util/filter/Between.java @@ -30,6 +30,7 @@ public class Between implements Filter { return endValue; } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { Object value = item.getItemProperty(getPropertyId()).getValue(); @@ -41,6 +42,7 @@ public class Between implements Filter { return false; } + @Override public boolean appliesToProperty(Object propertyId) { return getPropertyId() != null && getPropertyId().equals(propertyId); } diff --git a/src/com/vaadin/data/util/filter/Compare.java b/src/com/vaadin/data/util/filter/Compare.java index 111d95f055..4091f5b922 100644 --- a/src/com/vaadin/data/util/filter/Compare.java +++ b/src/com/vaadin/data/util/filter/Compare.java @@ -227,6 +227,7 @@ public abstract class Compare implements Filter { this.operation = operation; } + @Override public boolean passesFilter(Object itemId, Item item) { final Property p = item.getItemProperty(getPropertyId()); if (null == p) { @@ -264,6 +265,7 @@ public abstract class Compare implements Filter { + value1 + ", " + getValue()); } + @Override public boolean appliesToProperty(Object propertyId) { return getPropertyId().equals(propertyId); } diff --git a/src/com/vaadin/data/util/filter/IsNull.java b/src/com/vaadin/data/util/filter/IsNull.java index aad71a7c80..3faf4153ee 100644 --- a/src/com/vaadin/data/util/filter/IsNull.java +++ b/src/com/vaadin/data/util/filter/IsNull.java @@ -33,6 +33,7 @@ public final class IsNull implements Filter { this.propertyId = propertyId; } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { final Property p = item.getItemProperty(getPropertyId()); @@ -42,6 +43,7 @@ public final class IsNull implements Filter { return null == p.getValue(); } + @Override public boolean appliesToProperty(Object propertyId) { return getPropertyId().equals(propertyId); } diff --git a/src/com/vaadin/data/util/filter/Like.java b/src/com/vaadin/data/util/filter/Like.java index 723623bb69..3dcc48e809 100644 --- a/src/com/vaadin/data/util/filter/Like.java +++ b/src/com/vaadin/data/util/filter/Like.java @@ -37,6 +37,7 @@ public class Like implements Filter { return caseSensitive; } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { if (!item.getItemProperty(getPropertyId()).getType() @@ -54,6 +55,7 @@ public class Like implements Filter { return colValue.toUpperCase().matches(pattern.toUpperCase()); } + @Override public boolean appliesToProperty(Object propertyId) { return getPropertyId() != null && getPropertyId().equals(propertyId); } diff --git a/src/com/vaadin/data/util/filter/Not.java b/src/com/vaadin/data/util/filter/Not.java index 1731dcc2b5..bbfc9ca86a 100644 --- a/src/com/vaadin/data/util/filter/Not.java +++ b/src/com/vaadin/data/util/filter/Not.java @@ -36,6 +36,7 @@ public final class Not implements Filter { return filter; } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { return !filter.passesFilter(itemId, item); @@ -48,6 +49,7 @@ public final class Not implements Filter { * * @return boolean */ + @Override public boolean appliesToProperty(Object propertyId) { return filter.appliesToProperty(propertyId); } diff --git a/src/com/vaadin/data/util/filter/Or.java b/src/com/vaadin/data/util/filter/Or.java index 194afbc7da..b60074f7e3 100644 --- a/src/com/vaadin/data/util/filter/Or.java +++ b/src/com/vaadin/data/util/filter/Or.java @@ -30,6 +30,7 @@ public final class Or extends AbstractJunctionFilter { super(filters); } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedFilterException { for (Filter filter : getFilters()) { diff --git a/src/com/vaadin/data/util/filter/SimpleStringFilter.java b/src/com/vaadin/data/util/filter/SimpleStringFilter.java index 6203251045..f98b2c02b4 100644 --- a/src/com/vaadin/data/util/filter/SimpleStringFilter.java +++ b/src/com/vaadin/data/util/filter/SimpleStringFilter.java @@ -39,6 +39,7 @@ public final class SimpleStringFilter implements Filter { this.onlyMatchPrefix = onlyMatchPrefix; } + @Override public boolean passesFilter(Object itemId, Item item) { final Property p = item.getItemProperty(propertyId); if (p == null) { @@ -62,6 +63,7 @@ public final class SimpleStringFilter implements Filter { return true; } + @Override public boolean appliesToProperty(Object propertyId) { return this.propertyId.equals(propertyId); } diff --git a/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java b/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java index d84a164bfa..168bce1880 100644 --- a/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java +++ b/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java @@ -61,6 +61,7 @@ final public class ColumnProperty implements Property { this.readOnly = readOnly; } + @Override public Object getValue() { if (isModified()) { return changedValue; @@ -68,6 +69,7 @@ final public class ColumnProperty implements Property { return value; } + @Override public void setValue(Object newValue) throws ReadOnlyException { if (newValue == null && !nullable) { throw new NotNullableException( @@ -134,10 +136,12 @@ final public class ColumnProperty implements Property { || newValue.equals(referenceValue); } + @Override public Class getType() { return type; } + @Override public boolean isReadOnly() { return readOnly; } @@ -146,6 +150,7 @@ final public class ColumnProperty implements Property { return allowReadOnlyChange; } + @Override public void setReadOnly(boolean newStatus) { if (allowReadOnlyChange) { readOnly = newStatus; diff --git a/src/com/vaadin/data/util/sqlcontainer/RowItem.java b/src/com/vaadin/data/util/sqlcontainer/RowItem.java index adededb65c..d613a06b63 100644 --- a/src/com/vaadin/data/util/sqlcontainer/RowItem.java +++ b/src/com/vaadin/data/util/sqlcontainer/RowItem.java @@ -48,6 +48,7 @@ public final class RowItem implements Item { this.id = id; } + @Override public Property getItemProperty(Object id) { if (id instanceof String && id != null) { for (ColumnProperty cp : properties) { @@ -59,6 +60,7 @@ public final class RowItem implements Item { return null; } + @Override public Collection getItemPropertyIds() { Collection ids = new ArrayList(properties.size()); for (ColumnProperty cp : properties) { @@ -71,6 +73,7 @@ public final class RowItem implements Item { * Adding properties is not supported. Properties are generated by * SQLContainer. */ + @Override public boolean addItemProperty(Object id, Property property) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -80,6 +83,7 @@ public final class RowItem implements Item { * Removing properties is not supported. Properties are generated by * SQLContainer. */ + @Override public boolean removeItemProperty(Object id) throws UnsupportedOperationException { throw new UnsupportedOperationException(); diff --git a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index e9b5b4fea3..250b2eb4c3 100644 --- a/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -130,6 +130,7 @@ public class SQLContainer implements Container, Container.Filterable, * {@inheritDoc} */ + @Override public Object addItem() throws UnsupportedOperationException { Object emptyKey[] = new Object[delegate.getPrimaryKeyColumns().size()]; RowId itemId = new TemporaryRowId(emptyKey); @@ -186,6 +187,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#containsId(java.lang.Object) */ + @Override public boolean containsId(Object itemId) { if (itemId == null) { return false; @@ -227,6 +229,7 @@ public class SQLContainer implements Container, Container.Filterable, * java.lang.Object) */ + @Override public Property getContainerProperty(Object itemId, Object propertyId) { Item item = getItem(itemId); if (item == null) { @@ -241,6 +244,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#getContainerPropertyIds() */ + @Override public Collection getContainerPropertyIds() { return Collections.unmodifiableCollection(propertyIds); } @@ -251,6 +255,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#getItem(java.lang.Object) */ + @Override public Item getItem(Object itemId) { if (!cachedItems.containsKey(itemId)) { int index = indexOfId(itemId); @@ -298,6 +303,7 @@ public class SQLContainer implements Container, Container.Filterable, * {@inheritDoc} */ + @Override public Collection getItemIds() { updateCount(); ArrayList ids = new ArrayList(); @@ -355,6 +361,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#getType(java.lang.Object) */ + @Override public Class getType(Object propertyId) { if (!propertyIds.contains(propertyId)) { return null; @@ -368,6 +375,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#size() */ + @Override public int size() { updateCount(); return size + sizeOfAddedItems() - removedItems.size(); @@ -379,6 +387,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ + @Override public boolean removeItem(Object itemId) throws UnsupportedOperationException { if (!containsId(itemId)) { @@ -447,6 +456,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#removeAllItems() */ + @Override public boolean removeAllItems() throws UnsupportedOperationException { if (autoCommit) { /* Remove and commit instantly. */ @@ -508,6 +518,7 @@ public class SQLContainer implements Container, Container.Filterable, * {@inheritDoc} */ + @Override public void addContainerFilter(Filter filter) throws UnsupportedFilterException { // filter.setCaseSensitive(!ignoreCase); @@ -520,6 +531,7 @@ public class SQLContainer implements Container, Container.Filterable, * {@inheritDoc} */ + @Override public void removeContainerFilter(Filter filter) { filters.remove(filter); } @@ -560,6 +572,7 @@ public class SQLContainer implements Container, Container.Filterable, * {@inheritDoc} */ + @Override public void removeAllContainerFilters() { filters.clear(); refresh(); @@ -575,6 +588,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Indexed#indexOfId(java.lang.Object) */ + @Override public int indexOfId(Object itemId) { // First check if the id is in the added items for (int ix = 0; ix < addedItems.size(); ix++) { @@ -622,6 +636,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Indexed#getIdByIndex(int) */ + @Override public Object getIdByIndex(int index) { if (index < 0 || index > size() - 1) { return null; @@ -649,6 +664,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object) */ + @Override public Object nextItemId(Object itemId) { return getIdByIndex(indexOfId(itemId) + 1); } @@ -659,6 +675,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object) */ + @Override public Object prevItemId(Object itemId) { return getIdByIndex(indexOfId(itemId) - 1); } @@ -669,6 +686,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Ordered#firstItemId() */ + @Override public Object firstItemId() { updateCount(); if (size == 0) { @@ -697,6 +715,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Ordered#lastItemId() */ + @Override public Object lastItemId() { if (addedItems.isEmpty()) { int lastIx = size() - 1; @@ -723,6 +742,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object) */ + @Override public boolean isFirstId(Object itemId) { return firstItemId().equals(itemId); } @@ -733,6 +753,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object) */ + @Override public boolean isLastId(Object itemId) { return lastItemId().equals(itemId); } @@ -748,6 +769,7 @@ public class SQLContainer implements Container, Container.Filterable, * boolean[]) */ + @Override public void sort(Object[] propertyId, boolean[] ascending) { sorters.clear(); if (propertyId == null || propertyId.length == 0) { @@ -777,6 +799,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() */ + @Override public Collection getSortableContainerPropertyIds() { return getContainerPropertyIds(); } @@ -1351,6 +1374,7 @@ public class SQLContainer implements Container, Container.Filterable, * java.lang.Class, java.lang.Object) */ + @Override public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -1362,6 +1386,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object) */ + @Override public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -1373,6 +1398,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container#addItem(java.lang.Object) */ + @Override public Item addItem(Object itemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @@ -1384,6 +1410,7 @@ public class SQLContainer implements Container, Container.Filterable, * java.lang.Object) */ + @Override public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -1395,6 +1422,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Indexed#addItemAt(int, java.lang.Object) */ + @Override public Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -1406,6 +1434,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Indexed#addItemAt(int) */ + @Override public Object addItemAt(int index) throws UnsupportedOperationException { throw new UnsupportedOperationException(); } @@ -1416,6 +1445,7 @@ public class SQLContainer implements Container, Container.Filterable, * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) */ + @Override public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException { throw new UnsupportedOperationException(); @@ -1433,6 +1463,7 @@ public class SQLContainer implements Container, Container.Filterable, * .data.Container.ItemSetChangeListener) */ + @Override public void addListener(Container.ItemSetChangeListener listener) { if (itemSetChangeListeners == null) { itemSetChangeListeners = new LinkedList(); @@ -1448,6 +1479,7 @@ public class SQLContainer implements Container, Container.Filterable, * .data.Container.ItemSetChangeListener) */ + @Override public void removeListener(Container.ItemSetChangeListener listener) { if (itemSetChangeListeners != null) { itemSetChangeListeners.remove(listener); @@ -1477,6 +1509,7 @@ public class SQLContainer implements Container, Container.Filterable, super(source); } + @Override public Container getContainer() { return (Container) getSource(); } diff --git a/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java b/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java index 40d0d0426f..9aa4f7c4be 100644 --- a/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java +++ b/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java @@ -26,6 +26,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool { this.dataSourceJndiName = dataSourceJndiName; } + @Override public Connection reserveConnection() throws SQLException { Connection conn = getDataSource().getConnection(); conn.setAutoCommit(false); @@ -51,6 +52,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool { } } + @Override public void releaseConnection(Connection conn) { if (conn != null) { try { @@ -62,6 +64,7 @@ public class J2EEConnectionPool implements JDBCConnectionPool { } } + @Override public void destroy() { dataSource = null; } diff --git a/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java b/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java index 2a1068e786..21760014b9 100644 --- a/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java +++ b/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java @@ -81,6 +81,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { initialized = true; } + @Override public synchronized Connection reserveConnection() throws SQLException { if (!initialized) { initializeConnections(); @@ -100,6 +101,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { return c; } + @Override public synchronized void releaseConnection(Connection conn) { if (conn == null || !initialized) { return; @@ -139,6 +141,7 @@ public class SimpleJDBCConnectionPool implements JDBCConnectionPool { return c; } + @Override public void destroy() { for (Connection c : availableConnections) { try { diff --git a/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java b/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java index 56a8455a16..ec986fab95 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java @@ -99,6 +99,7 @@ public class FreeformQuery implements QueryDelegate { * * {@inheritDoc} */ + @Override public int getCount() throws SQLException { // First try the delegate int count = countByDelegate(); @@ -187,6 +188,7 @@ public class FreeformQuery implements QueryDelegate { * * @see FreeformQueryDelegate#getQueryString(int, int) */ + @Override @SuppressWarnings("deprecation") public ResultSet getResults(int offset, int pagelength) throws SQLException { if (activeConnection == null) { @@ -218,6 +220,7 @@ public class FreeformQuery implements QueryDelegate { return rs; } + @Override @SuppressWarnings("deprecation") public boolean implementationRespectsPagingLimits() { if (delegate == null) { @@ -251,6 +254,7 @@ public class FreeformQuery implements QueryDelegate { * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setFilters(java * .util.List) */ + @Override public void setFilters(List filters) throws UnsupportedOperationException { if (delegate != null) { @@ -268,6 +272,7 @@ public class FreeformQuery implements QueryDelegate { * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#setOrderBy(java * .util.List) */ + @Override public void setOrderBy(List orderBys) throws UnsupportedOperationException { if (delegate != null) { @@ -285,6 +290,7 @@ public class FreeformQuery implements QueryDelegate { * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin * .data.util.sqlcontainer.RowItem) */ + @Override public int storeRow(RowItem row) throws SQLException { if (activeConnection == null) { throw new IllegalStateException("No transaction is active!"); @@ -307,6 +313,7 @@ public class FreeformQuery implements QueryDelegate { * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin * .data.util.sqlcontainer.RowItem) */ + @Override public boolean removeRow(RowItem row) throws SQLException { if (activeConnection == null) { throw new IllegalStateException("No transaction is active!"); @@ -328,6 +335,7 @@ public class FreeformQuery implements QueryDelegate { * @see * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#beginTransaction() */ + @Override public synchronized void beginTransaction() throws UnsupportedOperationException, SQLException { if (activeConnection != null) { @@ -342,6 +350,7 @@ public class FreeformQuery implements QueryDelegate { * * @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#commit() */ + @Override public synchronized void commit() throws UnsupportedOperationException, SQLException { if (activeConnection == null) { @@ -359,6 +368,7 @@ public class FreeformQuery implements QueryDelegate { * * @see com.vaadin.data.util.sqlcontainer.query.QueryDelegate#rollback() */ + @Override public synchronized void rollback() throws UnsupportedOperationException, SQLException { if (activeConnection == null) { @@ -376,6 +386,7 @@ public class FreeformQuery implements QueryDelegate { * com.vaadin.data.util.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns * () */ + @Override public List getPrimaryKeyColumns() { return primaryKeyColumns; } @@ -403,6 +414,7 @@ public class FreeformQuery implements QueryDelegate { * @see FreeformQueryDelegate#getContainsRowQueryString(Object...) * */ + @Override @SuppressWarnings("deprecation") public boolean containsRowWithKey(Object... keys) throws SQLException { String query = null; diff --git a/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java b/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java index 22ca30cc32..d0606704f7 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java @@ -111,6 +111,7 @@ public class TableQuery implements QueryDelegate, * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getCount() */ + @Override public int getCount() throws SQLException { getLogger().log(Level.FINE, "Fetching count..."); StatementHelper sh = sqlGenerator.generateSelectQuery(tableName, @@ -137,6 +138,7 @@ public class TableQuery implements QueryDelegate, * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#getResults(int, * int) */ + @Override public ResultSet getResults(int offset, int pagelength) throws SQLException { StatementHelper sh; /* @@ -161,6 +163,7 @@ public class TableQuery implements QueryDelegate, * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate# * implementationRespectsPagingLimits() */ + @Override public boolean implementationRespectsPagingLimits() { return true; } @@ -172,6 +175,7 @@ public class TableQuery implements QueryDelegate, * com.vaadin.addon.sqlcontainer.query.QueryDelegate#storeRow(com.vaadin * .addon.sqlcontainer.RowItem) */ + @Override public int storeRow(RowItem row) throws UnsupportedOperationException, SQLException { if (row == null) { @@ -254,6 +258,7 @@ public class TableQuery implements QueryDelegate, * com.vaadin.addon.sqlcontainer.query.QueryDelegate#setFilters(java.util * .List) */ + @Override public void setFilters(List filters) throws UnsupportedOperationException { if (filters == null) { @@ -270,6 +275,7 @@ public class TableQuery implements QueryDelegate, * com.vaadin.addon.sqlcontainer.query.QueryDelegate#setOrderBy(java.util * .List) */ + @Override public void setOrderBy(List orderBys) throws UnsupportedOperationException { if (orderBys == null) { @@ -284,6 +290,7 @@ public class TableQuery implements QueryDelegate, * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#beginTransaction() */ + @Override public void beginTransaction() throws UnsupportedOperationException, SQLException { if (transactionOpen && activeConnection != null) { @@ -301,6 +308,7 @@ public class TableQuery implements QueryDelegate, * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#commit() */ + @Override public void commit() throws UnsupportedOperationException, SQLException { if (transactionOpen && activeConnection != null) { getLogger().log(Level.FINE, "DB -> commit"); @@ -329,6 +337,7 @@ public class TableQuery implements QueryDelegate, * * @see com.vaadin.addon.sqlcontainer.query.QueryDelegate#rollback() */ + @Override public void rollback() throws UnsupportedOperationException, SQLException { if (transactionOpen && activeConnection != null) { getLogger().log(Level.FINE, "DB -> rollback"); @@ -346,6 +355,7 @@ public class TableQuery implements QueryDelegate, * @see * com.vaadin.addon.sqlcontainer.query.QueryDelegate#getPrimaryKeyColumns() */ + @Override public List getPrimaryKeyColumns() { return Collections.unmodifiableList(primaryKeyColumns); } @@ -581,6 +591,7 @@ public class TableQuery implements QueryDelegate, * com.vaadin.addon.sqlcontainer.query.QueryDelegate#removeRow(com.vaadin * .addon.sqlcontainer.RowItem) */ + @Override public boolean removeRow(RowItem row) throws UnsupportedOperationException, SQLException { getLogger().log(Level.FINE, @@ -604,6 +615,7 @@ public class TableQuery implements QueryDelegate, * com.vaadin.addon.sqlcontainer.query.QueryDelegate#containsRowWithKey( * java.lang.Object[]) */ + @Override public boolean containsRowWithKey(Object... keys) throws SQLException { ArrayList filtersAndKeys = new ArrayList(); if (filters != null) { @@ -665,10 +677,12 @@ public class TableQuery implements QueryDelegate, this.newId = newId; } + @Override public RowId getNewRowId() { return newId; } + @Override public RowId getOldRowId() { return oldId; } @@ -677,6 +691,7 @@ public class TableQuery implements QueryDelegate, /** * Adds RowIdChangeListener to this query */ + @Override public void addListener(RowIdChangeListener listener) { if (rowIdChangeListeners == null) { rowIdChangeListeners = new LinkedList(); @@ -687,6 +702,7 @@ public class TableQuery implements QueryDelegate, /** * Removes the given RowIdChangeListener from this query */ + @Override public void removeListener(RowIdChangeListener listener) { if (rowIdChangeListeners != null) { rowIdChangeListeners.remove(listener); diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java index 24d283c9ab..a6798f972b 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java @@ -51,6 +51,7 @@ public class DefaultSQLGenerator implements SQLGenerator { * generateSelectQuery(java.lang.String, java.util.List, java.util.List, * int, int, java.lang.String) */ + @Override public StatementHelper generateSelectQuery(String tableName, List filters, List orderBys, int offset, int pagelength, String toSelect) { @@ -84,6 +85,7 @@ public class DefaultSQLGenerator implements SQLGenerator { * generateUpdateQuery(java.lang.String, * com.vaadin.addon.sqlcontainer.RowItem) */ + @Override public StatementHelper generateUpdateQuery(String tableName, RowItem item) { if (tableName == null || tableName.trim().equals("")) { throw new IllegalArgumentException("Table name must be given."); @@ -133,6 +135,7 @@ public class DefaultSQLGenerator implements SQLGenerator { * generateInsertQuery(java.lang.String, * com.vaadin.addon.sqlcontainer.RowItem) */ + @Override public StatementHelper generateInsertQuery(String tableName, RowItem item) { if (tableName == null || tableName.trim().equals("")) { throw new IllegalArgumentException("Table name must be given."); @@ -184,6 +187,7 @@ public class DefaultSQLGenerator implements SQLGenerator { * generateDeleteQuery(java.lang.String, * com.vaadin.addon.sqlcontainer.RowItem) */ + @Override public StatementHelper generateDeleteQuery(String tableName, List primaryKeyColumns, String versionColumn, RowItem item) { if (tableName == null || tableName.trim().equals("")) { diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java index 02d6671b60..251a543a8a 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java @@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class AndTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof And; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { return QueryBuilder.group(QueryBuilder.getJoinedFilterString( ((And) filter).getFilters(), "AND", sh)); diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java index e8a87a82d8..4fcaf759ea 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java @@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class BetweenTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof Between; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { Between between = (Between) filter; sh.addParameterValue(between.getStartValue()); diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java index 72d72dd069..4293e1d630 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java @@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class CompareTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof Compare; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { Compare compare = (Compare) filter; sh.addParameterValue(compare.getValue()); diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java index 2593bbae57..a2a6cd2c09 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java @@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class IsNullTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof IsNull; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { IsNull in = (IsNull) filter; return QueryBuilder.quote(in.getPropertyId()) + " IS NULL"; diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java index b1c779ae73..25a85caec0 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java @@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class LikeTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof Like; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { Like like = (Like) filter; if (like.isCaseSensitive()) { diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java index 7c1bba2bb5..5dfbe240e7 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java @@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class NotTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof Not; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { Not not = (Not) filter; if (not.getFilter() instanceof IsNull) { diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java index 9724ee7944..2f0ed814e0 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java @@ -9,10 +9,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class OrTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof Or; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { return QueryBuilder.group(QueryBuilder.getJoinedFilterString( ((Or) filter).getFilters(), "OR", sh)); diff --git a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java index 1aae68abc0..f108003535 100644 --- a/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java +++ b/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java @@ -10,10 +10,12 @@ import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper; public class SimpleStringTranslator implements FilterTranslator { + @Override public boolean translatesFilter(Filter filter) { return filter instanceof SimpleStringFilter; } + @Override public String getWhereStringForFilter(Filter filter, StatementHelper sh) { SimpleStringFilter ssf = (SimpleStringFilter) filter; // Create a Like filter based on the SimpleStringFilter and execute the diff --git a/src/com/vaadin/data/validator/AbstractValidator.java b/src/com/vaadin/data/validator/AbstractValidator.java index 27eaaca485..8febe5338a 100644 --- a/src/com/vaadin/data/validator/AbstractValidator.java +++ b/src/com/vaadin/data/validator/AbstractValidator.java @@ -84,6 +84,7 @@ public abstract class AbstractValidator implements Validator { */ protected abstract boolean isValidValue(T value); + @Override public void validate(Object value) throws InvalidValueException { // isValidType ensures that value can safely be cast to TYPE if (!isValidType(value) || !isValidValue((T) value)) { diff --git a/src/com/vaadin/data/validator/BeanValidator.java b/src/com/vaadin/data/validator/BeanValidator.java index 817df85248..816ff79b83 100644 --- a/src/com/vaadin/data/validator/BeanValidator.java +++ b/src/com/vaadin/data/validator/BeanValidator.java @@ -67,10 +67,12 @@ public class BeanValidator implements Validator { this.descriptor = descriptor; } + @Override public ConstraintDescriptor getConstraintDescriptor() { return descriptor; } + @Override public Object getValidatedValue() { return value; } @@ -96,6 +98,7 @@ public class BeanValidator implements Validator { * * @see com.vaadin.data.Validator#validate(java.lang.Object) */ + @Override public void validate(final Object value) throws InvalidValueException { Set violations = getJavaxBeanValidator().validateValue(beanClass, propertyName, value); diff --git a/src/com/vaadin/data/validator/CompositeValidator.java b/src/com/vaadin/data/validator/CompositeValidator.java index 956d773032..cad31c9d4d 100644 --- a/src/com/vaadin/data/validator/CompositeValidator.java +++ b/src/com/vaadin/data/validator/CompositeValidator.java @@ -101,6 +101,7 @@ public class CompositeValidator implements Validator { * @throws Validator.InvalidValueException * if the value is not valid. */ + @Override public void validate(Object value) throws Validator.InvalidValueException { switch (mode) { case AND: diff --git a/src/com/vaadin/data/validator/NullValidator.java b/src/com/vaadin/data/validator/NullValidator.java index 62b2580d48..551d88c776 100644 --- a/src/com/vaadin/data/validator/NullValidator.java +++ b/src/com/vaadin/data/validator/NullValidator.java @@ -43,6 +43,7 @@ public class NullValidator implements Validator { * @throws Validator.InvalidValueException * if the value was invalid. */ + @Override public void validate(Object value) throws Validator.InvalidValueException { if ((onlyNullAllowed && value != null) || (!onlyNullAllowed && value == null)) { diff --git a/src/com/vaadin/event/ActionManager.java b/src/com/vaadin/event/ActionManager.java index 08e9c85043..64fdeea69b 100644 --- a/src/com/vaadin/event/ActionManager.java +++ b/src/com/vaadin/event/ActionManager.java @@ -75,6 +75,7 @@ public class ActionManager implements Action.Container, Action.Handler, requestRepaint(); // this goes to the new viewer } + @Override public void addAction(T action) { if (ownActions == null) { ownActions = new HashSet(); @@ -84,6 +85,7 @@ public class ActionManager implements Action.Container, Action.Handler, } } + @Override public void removeAction(T action) { if (ownActions != null) { if (ownActions.remove(action)) { @@ -92,6 +94,7 @@ public class ActionManager implements Action.Container, Action.Handler, } } + @Override public void addActionHandler(Handler actionHandler) { if (actionHandler == this) { // don't add the actionHandler to itself @@ -109,6 +112,7 @@ public class ActionManager implements Action.Container, Action.Handler, } } + @Override public void removeActionHandler(Action.Handler actionHandler) { if (actionHandlers != null && actionHandlers.contains(actionHandler)) { @@ -206,6 +210,7 @@ public class ActionManager implements Action.Container, Action.Handler, } } + @Override public Action[] getActions(Object target, Object sender) { HashSet actions = new HashSet(); if (ownActions != null) { @@ -226,6 +231,7 @@ public class ActionManager implements Action.Container, Action.Handler, return actions.toArray(new Action[actions.size()]); } + @Override public void handleAction(Action action, Object sender, Object target) { if (actionHandlers != null) { Handler[] array = actionHandlers.toArray(new Handler[actionHandlers diff --git a/src/com/vaadin/event/EventRouter.java b/src/com/vaadin/event/EventRouter.java index 49b29de9bb..90c080b860 100644 --- a/src/com/vaadin/event/EventRouter.java +++ b/src/com/vaadin/event/EventRouter.java @@ -35,6 +35,7 @@ public class EventRouter implements MethodEventSource { * events generated by this component. Don't add a JavaDoc comment here, we * use the default documentation from implemented interface. */ + @Override public void addListener(Class eventType, Object object, Method method) { if (listenerList == null) { listenerList = new LinkedHashSet(); @@ -47,6 +48,7 @@ public class EventRouter implements MethodEventSource { * listen events generated by this component. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public void addListener(Class eventType, Object object, String methodName) { if (listenerList == null) { listenerList = new LinkedHashSet(); @@ -59,6 +61,7 @@ public class EventRouter implements MethodEventSource { * a JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public void removeListener(Class eventType, Object target) { if (listenerList != null) { final Iterator i = listenerList.iterator(); @@ -77,6 +80,7 @@ public class EventRouter implements MethodEventSource { * Don't add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public void removeListener(Class eventType, Object target, Method method) { if (listenerList != null) { final Iterator i = listenerList.iterator(); @@ -95,6 +99,7 @@ public class EventRouter implements MethodEventSource { * Don't add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public void removeListener(Class eventType, Object target, String methodName) { diff --git a/src/com/vaadin/event/FieldEvents.java b/src/com/vaadin/event/FieldEvents.java index 20e9fabb36..3c5f0f5652 100644 --- a/src/com/vaadin/event/FieldEvents.java +++ b/src/com/vaadin/event/FieldEvents.java @@ -261,10 +261,12 @@ public interface FieldEvents { protected abstract void fireEvent(Event event); + @Override public void blur() { fireEvent(new BlurEvent(component)); } + @Override public void focus() { fireEvent(new FocusEvent(component)); } diff --git a/src/com/vaadin/event/ShortcutListener.java b/src/com/vaadin/event/ShortcutListener.java index 0656ed0e1f..b760cfabe6 100644 --- a/src/com/vaadin/event/ShortcutListener.java +++ b/src/com/vaadin/event/ShortcutListener.java @@ -28,5 +28,6 @@ public abstract class ShortcutListener extends ShortcutAction implements super(shorthandCaption); } + @Override abstract public void handleAction(Object sender, Object target); } diff --git a/src/com/vaadin/event/TransferableImpl.java b/src/com/vaadin/event/TransferableImpl.java index 621ea95bc1..4c973571f7 100644 --- a/src/com/vaadin/event/TransferableImpl.java +++ b/src/com/vaadin/event/TransferableImpl.java @@ -24,18 +24,22 @@ public class TransferableImpl implements Transferable { this.rawVariables = rawVariables; } + @Override public Component getSourceComponent() { return sourceComponent; } + @Override public Object getData(String dataFlavor) { return rawVariables.get(dataFlavor); } + @Override public void setData(String dataFlavor, Object value) { rawVariables.put(dataFlavor, value); } + @Override public Collection getDataFlavors() { return rawVariables.keySet(); } diff --git a/src/com/vaadin/event/dd/TargetDetailsImpl.java b/src/com/vaadin/event/dd/TargetDetailsImpl.java index 27afc32680..4a459777ed 100644 --- a/src/com/vaadin/event/dd/TargetDetailsImpl.java +++ b/src/com/vaadin/event/dd/TargetDetailsImpl.java @@ -29,6 +29,7 @@ public class TargetDetailsImpl implements TargetDetails { this.dropTarget = dropTarget; } + @Override public Object getData(String key) { return data.get(key); } @@ -37,6 +38,7 @@ public class TargetDetailsImpl implements TargetDetails { return data.put(key, value); } + @Override public DropTarget getTarget() { return dropTarget; } diff --git a/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java b/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java index 52ffab9263..1457ea9df3 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java +++ b/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java @@ -29,6 +29,7 @@ public final class AcceptAll extends ClientSideCriterion { return singleton; } + @Override public boolean accept(DragAndDropEvent dragEvent) { return true; } diff --git a/src/com/vaadin/event/dd/acceptcriteria/And.java b/src/com/vaadin/event/dd/acceptcriteria/And.java index a0340a9cdb..4122d67160 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/And.java +++ b/src/com/vaadin/event/dd/acceptcriteria/And.java @@ -41,6 +41,7 @@ public class And extends ClientSideCriterion { } } + @Override public boolean accept(DragAndDropEvent dragEvent) { for (ClientSideCriterion crit : criteria) { if (!crit.accept(dragEvent)) { diff --git a/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java b/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java index 0f4ae2990c..7d2c42ecb0 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java +++ b/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java @@ -33,10 +33,12 @@ public abstract class ClientSideCriterion implements Serializable, * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#isClientSideVerifiable * () */ + @Override public final boolean isClientSideVerifiable() { return true; } + @Override public void paint(PaintTarget target) throws PaintException { target.startTag("-ac"); target.addAttribute("name", getIdentifier()); @@ -51,6 +53,7 @@ public abstract class ClientSideCriterion implements Serializable, return getClass().getCanonicalName(); } + @Override public final void paintResponse(PaintTarget target) throws PaintException { // NOP, nothing to do as this is client side verified criterion } diff --git a/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java b/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java index 7eb04d9647..4c52698a4a 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java +++ b/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java @@ -39,6 +39,7 @@ public class ContainsDataFlavor extends ClientSideCriterion { target.addAttribute("p", dataFlavorId); } + @Override public boolean accept(DragAndDropEvent dragEvent) { return dragEvent.getTransferable().getDataFlavors() .contains(dataFlavorId); diff --git a/src/com/vaadin/event/dd/acceptcriteria/Not.java b/src/com/vaadin/event/dd/acceptcriteria/Not.java index 85ff7e9bc9..1ed40a324d 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/Not.java +++ b/src/com/vaadin/event/dd/acceptcriteria/Not.java @@ -31,6 +31,7 @@ public class Not extends ClientSideCriterion { acceptCriterion.paint(target); } + @Override public boolean accept(DragAndDropEvent dragEvent) { return !acceptCriterion.accept(dragEvent); } diff --git a/src/com/vaadin/event/dd/acceptcriteria/Or.java b/src/com/vaadin/event/dd/acceptcriteria/Or.java index 077e9114d8..6ad45c54af 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/Or.java +++ b/src/com/vaadin/event/dd/acceptcriteria/Or.java @@ -39,6 +39,7 @@ public class Or extends ClientSideCriterion { } } + @Override public boolean accept(DragAndDropEvent dragEvent) { for (AcceptCriterion crit : criteria) { if (crit.accept(dragEvent)) { diff --git a/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java b/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java index 77840bc94f..47f06d434c 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java +++ b/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java @@ -31,10 +31,12 @@ public abstract class ServerSideCriterion implements Serializable, private static final long serialVersionUID = 2128510128911628902L; + @Override public final boolean isClientSideVerifiable() { return false; } + @Override public void paint(PaintTarget target) throws PaintException { target.startTag("-ac"); target.addAttribute("name", getIdentifier()); @@ -45,6 +47,7 @@ public abstract class ServerSideCriterion implements Serializable, public void paintContent(PaintTarget target) { } + @Override public void paintResponse(PaintTarget target) throws PaintException { } diff --git a/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java b/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java index d7c47dc915..d4fd20c952 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java +++ b/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java @@ -49,6 +49,7 @@ public class SourceIs extends ClientSideCriterion { target.addAttribute("c", paintedComponents); } + @Override public boolean accept(DragAndDropEvent dragEvent) { if (dragEvent.getTransferable() instanceof TransferableImpl) { Component sourceComponent = ((TransferableImpl) dragEvent diff --git a/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java b/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java index 454159b3da..a644b858e2 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java +++ b/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java @@ -33,6 +33,7 @@ public class SourceIsTarget extends ClientSideCriterion { private SourceIsTarget() { } + @Override public boolean accept(DragAndDropEvent dragEvent) { if (dragEvent.getTransferable() instanceof TransferableImpl) { Component sourceComponent = ((TransferableImpl) dragEvent diff --git a/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java b/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java index 641fddc3ea..5df8f3f618 100644 --- a/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java +++ b/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java @@ -58,6 +58,7 @@ public class TargetDetailIs extends ClientSideCriterion { } } + @Override public boolean accept(DragAndDropEvent dragEvent) { Object data = dragEvent.getTargetDetails().getData(propertyName); return value.equals(data); diff --git a/src/com/vaadin/external/json/JSONException.java b/src/com/vaadin/external/json/JSONException.java index fecc38974e..895ffcb457 100644 --- a/src/com/vaadin/external/json/JSONException.java +++ b/src/com/vaadin/external/json/JSONException.java @@ -25,6 +25,7 @@ public class JSONException extends Exception { this.cause = cause; } + @Override public Throwable getCause() { return this.cause; } diff --git a/src/com/vaadin/external/json/JSONStringer.java b/src/com/vaadin/external/json/JSONStringer.java index e4ccc8e195..ae905cb15f 100644 --- a/src/com/vaadin/external/json/JSONStringer.java +++ b/src/com/vaadin/external/json/JSONStringer.java @@ -77,6 +77,7 @@ public class JSONStringer extends JSONWriter { * * @return The JSON text. */ + @Override public String toString() { return this.mode == 'd' ? this.writer.toString() : null; } diff --git a/src/com/vaadin/navigator/Navigator.java b/src/com/vaadin/navigator/Navigator.java index c5e7de836a..1813301fe6 100644 --- a/src/com/vaadin/navigator/Navigator.java +++ b/src/com/vaadin/navigator/Navigator.java @@ -54,6 +54,7 @@ public class Navigator implements Serializable { setHeight("0px"); } + @Override public void navigateTo(String fragmentParameters) { // nothing to do } @@ -88,14 +89,17 @@ public class Navigator implements Serializable { page.addListener(this); } + @Override public String getFragment() { return page.getFragment(); } + @Override public void setFragment(String fragment) { page.setFragment(fragment, false); } + @Override public void fragmentChanged(FragmentChangedEvent event) { UriFragmentManager.this.navigator.navigateTo(getFragment()); } @@ -122,6 +126,7 @@ public class Navigator implements Serializable { setSizeFull(); } + @Override public void showView(View view) { if (view instanceof Component) { setCompositionRoot((Component) view); @@ -155,6 +160,7 @@ public class Navigator implements Serializable { this.container = container; } + @Override public void showView(View view) { if (view instanceof Component) { container.removeAllComponents(); @@ -190,6 +196,7 @@ public class Navigator implements Serializable { this.view = view; } + @Override public String getViewName(String viewAndParameters) { if (null == viewAndParameters) { return null; @@ -200,6 +207,7 @@ public class Navigator implements Serializable { return null; } + @Override public View getView(String viewName) { if (this.viewName.equals(viewName)) { return view; @@ -250,6 +258,7 @@ public class Navigator implements Serializable { this.viewClass = viewClass; } + @Override public String getViewName(String viewAndParameters) { if (null == viewAndParameters) { return null; @@ -261,6 +270,7 @@ public class Navigator implements Serializable { return null; } + @Override public View getView(String viewName) { if (this.viewName.equals(viewName)) { try { diff --git a/src/com/vaadin/terminal/AbstractClientConnector.java b/src/com/vaadin/terminal/AbstractClientConnector.java index 752b5326fc..564643c1fc 100644 --- a/src/com/vaadin/terminal/AbstractClientConnector.java +++ b/src/com/vaadin/terminal/AbstractClientConnector.java @@ -69,6 +69,7 @@ public abstract class AbstractClientConnector implements ClientConnector { private ClientConnector parent; /* Documentation copied from interface */ + @Override public void requestRepaint() { Root root = getRoot(); if (root != null) { @@ -125,6 +126,7 @@ public abstract class AbstractClientConnector implements ClientConnector { registerRpc(implementation, type); } + @Override public SharedState getState() { if (null == sharedState) { sharedState = createState(); @@ -164,6 +166,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * * @see com.vaadin.terminal.gwt.server.ClientConnector#getStateType() */ + @Override public Class getStateType() { try { Method m = getClass().getMethod("getState", (Class[]) null); @@ -214,6 +217,7 @@ public abstract class AbstractClientConnector implements ClientConnector { this.connector = connector; } + @Override public Iterator iterator() { CombinedIterator iterator = new CombinedIterator(); iterator.addIterator(connector.getExtensions().iterator()); @@ -236,6 +240,7 @@ public abstract class AbstractClientConnector implements ClientConnector { rpcInterfaceName = rpcInterface.getName().replaceAll("\\$", "."); } + @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { addMethodInvocationToQueue(rpcInterfaceName, method, args); @@ -274,10 +279,12 @@ public abstract class AbstractClientConnector implements ClientConnector { * * @since 7.0 */ + @Override public RpcManager getRpcManager(Class rpcInterface) { return rpcManagerMap.get(rpcInterface); } + @Override public List retrievePendingRpcCalls() { if (pendingInvocations.isEmpty()) { return Collections.emptyList(); @@ -288,6 +295,7 @@ public abstract class AbstractClientConnector implements ClientConnector { } } + @Override public String getConnectorId() { if (connectorId == null) { if (getApplication() == null) { @@ -322,6 +330,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * @return the Root ancestor of this connector, or null if none * is found. */ + @Override public Root getRoot() { ClientConnector connector = this; while (connector != null) { @@ -337,6 +346,7 @@ public abstract class AbstractClientConnector implements ClientConnector { return Logger.getLogger(AbstractClientConnector.class.getName()); } + @Override public void requestRepaintAll() { requestRepaint(); @@ -354,6 +364,7 @@ public abstract class AbstractClientConnector implements ClientConnector { iterators.add(iterator); } + @Override public boolean hasNext() { for (Iterator i : iterators) { if (i.hasNext()) { @@ -363,6 +374,7 @@ public abstract class AbstractClientConnector implements ClientConnector { return false; } + @Override public T next() { for (Iterator i : iterators) { if (i.hasNext()) { @@ -372,6 +384,7 @@ public abstract class AbstractClientConnector implements ClientConnector { throw new NoSuchElementException(); } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -390,6 +403,7 @@ public abstract class AbstractClientConnector implements ClientConnector { return new AllChildrenIterable(connector); } + @Override public Collection getExtensions() { return Collections.unmodifiableCollection(extensions); } @@ -416,12 +430,14 @@ public abstract class AbstractClientConnector implements ClientConnector { requestRepaint(); } + @Override public void removeExtension(Extension extension) { extension.setParent(null); extensions.remove(extension); requestRepaint(); } + @Override public void setParent(ClientConnector parent) { // If the parent is not changed, don't do anything @@ -448,10 +464,12 @@ public abstract class AbstractClientConnector implements ClientConnector { } } + @Override public ClientConnector getParent() { return parent; } + @Override public void attach() { requestRepaint(); @@ -471,6 +489,7 @@ public abstract class AbstractClientConnector implements ClientConnector { * null after this method is called. *

    */ + @Override public void detach() { for (ClientConnector connector : getAllChildrenIterable(this)) { connector.detach(); @@ -479,6 +498,7 @@ public abstract class AbstractClientConnector implements ClientConnector { getRoot().getConnectorTracker().unregisterConnector(this); } + @Override public boolean isConnectorEnabled() { if (getParent() == null) { // No parent -> the component cannot receive updates from the client diff --git a/src/com/vaadin/terminal/AbstractErrorMessage.java b/src/com/vaadin/terminal/AbstractErrorMessage.java index 3f526f7339..f7cd0e6aad 100644 --- a/src/com/vaadin/terminal/AbstractErrorMessage.java +++ b/src/com/vaadin/terminal/AbstractErrorMessage.java @@ -68,6 +68,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { } /* Documented in interface */ + @Override public ErrorLevel getErrorLevel() { return level; } @@ -92,6 +93,7 @@ public abstract class AbstractErrorMessage implements ErrorMessage { causes.add(cause); } + @Override public String getFormattedHtmlMessage() { String result = null; switch (getMode()) { diff --git a/src/com/vaadin/terminal/ClassResource.java b/src/com/vaadin/terminal/ClassResource.java index e7419576f1..b74c8e7bb7 100644 --- a/src/com/vaadin/terminal/ClassResource.java +++ b/src/com/vaadin/terminal/ClassResource.java @@ -89,6 +89,7 @@ public class ClassResource implements ApplicationResource, Serializable { * * @see com.vaadin.terminal.Resource#getMIMEType() */ + @Override public String getMIMEType() { return FileTypeResolver.getMIMEType(resourceName); } @@ -98,6 +99,7 @@ public class ClassResource implements ApplicationResource, Serializable { * * @see com.vaadin.terminal.ApplicationResource#getApplication() */ + @Override public Application getApplication() { return application; } @@ -108,6 +110,7 @@ public class ClassResource implements ApplicationResource, Serializable { * @return the file name associated to this resource. * @see com.vaadin.terminal.ApplicationResource#getFilename() */ + @Override public String getFilename() { int index = 0; int next = 0; @@ -123,6 +126,7 @@ public class ClassResource implements ApplicationResource, Serializable { * * @see com.vaadin.terminal.ApplicationResource#getStream() */ + @Override public DownloadStream getStream() { final DownloadStream ds = new DownloadStream( associatedClass.getResourceAsStream(resourceName), @@ -133,6 +137,7 @@ public class ClassResource implements ApplicationResource, Serializable { } /* documented in superclass */ + @Override public int getBufferSize() { return bufferSize; } @@ -148,6 +153,7 @@ public class ClassResource implements ApplicationResource, Serializable { } /* documented in superclass */ + @Override public long getCacheTime() { return cacheTime; } diff --git a/src/com/vaadin/terminal/CombinedRequest.java b/src/com/vaadin/terminal/CombinedRequest.java index abf5e0412a..5b92feb39a 100644 --- a/src/com/vaadin/terminal/CombinedRequest.java +++ b/src/com/vaadin/terminal/CombinedRequest.java @@ -63,6 +63,7 @@ public class CombinedRequest implements WrappedRequest { } + @Override public String getParameter(String parameter) { String[] strings = getParameterMap().get(parameter); if (strings == null || strings.length == 0) { @@ -72,48 +73,60 @@ public class CombinedRequest implements WrappedRequest { } } + @Override public Map getParameterMap() { return parameterMap; } + @Override public int getContentLength() { return secondRequest.getContentLength(); } + @Override public InputStream getInputStream() throws IOException { return secondRequest.getInputStream(); } + @Override public Object getAttribute(String name) { return secondRequest.getAttribute(name); } + @Override public void setAttribute(String name, Object value) { secondRequest.setAttribute(name, value); } + @Override public String getRequestPathInfo() { return secondRequest.getParameter("initialPath"); } + @Override public int getSessionMaxInactiveInterval() { return secondRequest.getSessionMaxInactiveInterval(); } + @Override public Object getSessionAttribute(String name) { return secondRequest.getSessionAttribute(name); } + @Override public void setSessionAttribute(String name, Object attribute) { secondRequest.setSessionAttribute(name, attribute); } + @Override public String getContentType() { return secondRequest.getContentType(); } + @Override public BrowserDetails getBrowserDetails() { return new BrowserDetails() { + @Override public String getUriFragment() { String fragment = secondRequest.getParameter("fr"); if (fragment == null) { @@ -123,10 +136,12 @@ public class CombinedRequest implements WrappedRequest { } } + @Override public String getWindowName() { return secondRequest.getParameter("wn"); } + @Override public WebBrowser getWebBrowser() { WebApplicationContext context = (WebApplicationContext) Application .getCurrent().getContext(); @@ -145,22 +160,27 @@ public class CombinedRequest implements WrappedRequest { return secondRequest; } + @Override public Locale getLocale() { return secondRequest.getLocale(); } + @Override public String getRemoteAddr() { return secondRequest.getRemoteAddr(); } + @Override public boolean isSecure() { return secondRequest.isSecure(); } + @Override public String getHeader(String name) { return secondRequest.getHeader(name); } + @Override public DeploymentConfiguration getDeploymentConfiguration() { return secondRequest.getDeploymentConfiguration(); } diff --git a/src/com/vaadin/terminal/ExternalResource.java b/src/com/vaadin/terminal/ExternalResource.java index 0abff91638..84fcc65a44 100644 --- a/src/com/vaadin/terminal/ExternalResource.java +++ b/src/com/vaadin/terminal/ExternalResource.java @@ -100,6 +100,7 @@ public class ExternalResource implements Resource, Serializable { * * @see com.vaadin.terminal.Resource#getMIMEType() */ + @Override public String getMIMEType() { if (mimeType == null) { mimeType = FileTypeResolver.getMIMEType(getURL().toString()); diff --git a/src/com/vaadin/terminal/FileResource.java b/src/com/vaadin/terminal/FileResource.java index 8dc3b00fd0..e3c9f0172a 100644 --- a/src/com/vaadin/terminal/FileResource.java +++ b/src/com/vaadin/terminal/FileResource.java @@ -61,6 +61,7 @@ public class FileResource implements ApplicationResource { * * @see com.vaadin.terminal.ApplicationResource#getStream() */ + @Override public DownloadStream getStream() { try { final DownloadStream ds = new DownloadStream(new FileInputStream( @@ -74,6 +75,7 @@ public class FileResource implements ApplicationResource { // Log the exception using the application error handler getApplication().getErrorHandler().terminalError(new ErrorEvent() { + @Override public Throwable getThrowable() { return e; } @@ -106,6 +108,7 @@ public class FileResource implements ApplicationResource { /** * @see com.vaadin.terminal.ApplicationResource#getApplication() */ + @Override public Application getApplication() { return application; } @@ -113,6 +116,7 @@ public class FileResource implements ApplicationResource { /** * @see com.vaadin.terminal.ApplicationResource#getFilename() */ + @Override public String getFilename() { return sourceFile.getName(); } @@ -120,6 +124,7 @@ public class FileResource implements ApplicationResource { /** * @see com.vaadin.terminal.Resource#getMIMEType() */ + @Override public String getMIMEType() { return FileTypeResolver.getMIMEType(sourceFile); } @@ -132,6 +137,7 @@ public class FileResource implements ApplicationResource { * * @return Cache time in milliseconds. */ + @Override public long getCacheTime() { return cacheTime; } @@ -150,6 +156,7 @@ public class FileResource implements ApplicationResource { } /* documented in superclass */ + @Override public int getBufferSize() { return bufferSize; } diff --git a/src/com/vaadin/terminal/JavaScriptCallbackHelper.java b/src/com/vaadin/terminal/JavaScriptCallbackHelper.java index 01db0267d9..4b052c33d9 100644 --- a/src/com/vaadin/terminal/JavaScriptCallbackHelper.java +++ b/src/com/vaadin/terminal/JavaScriptCallbackHelper.java @@ -65,6 +65,7 @@ public class JavaScriptCallbackHelper implements Serializable { private void ensureRpc() { if (javascriptCallbackRpc == null) { javascriptCallbackRpc = new JavaScriptCallbackRpc() { + @Override public void call(String name, JSONArray arguments) { JavaScriptCallback callback = callbacks.get(name); try { diff --git a/src/com/vaadin/terminal/StreamResource.java b/src/com/vaadin/terminal/StreamResource.java index 1e13169292..1afd91dc08 100644 --- a/src/com/vaadin/terminal/StreamResource.java +++ b/src/com/vaadin/terminal/StreamResource.java @@ -79,6 +79,7 @@ public class StreamResource implements ApplicationResource { /** * @see com.vaadin.terminal.Resource#getMIMEType() */ + @Override public String getMIMEType() { if (MIMEType != null) { return MIMEType; @@ -123,6 +124,7 @@ public class StreamResource implements ApplicationResource { * * @return the filename. */ + @Override public String getFilename() { return filename; } @@ -140,6 +142,7 @@ public class StreamResource implements ApplicationResource { /** * @see com.vaadin.terminal.ApplicationResource#getApplication() */ + @Override public Application getApplication() { return application; } @@ -147,6 +150,7 @@ public class StreamResource implements ApplicationResource { /** * @see com.vaadin.terminal.ApplicationResource#getStream() */ + @Override public DownloadStream getStream() { final StreamSource ss = getStreamSource(); if (ss == null) { @@ -176,6 +180,7 @@ public class StreamResource implements ApplicationResource { } /* documented in superclass */ + @Override public int getBufferSize() { return bufferSize; } @@ -191,6 +196,7 @@ public class StreamResource implements ApplicationResource { } /* documented in superclass */ + @Override public long getCacheTime() { return cacheTime; } diff --git a/src/com/vaadin/terminal/ThemeResource.java b/src/com/vaadin/terminal/ThemeResource.java index d456047653..41674b2373 100644 --- a/src/com/vaadin/terminal/ThemeResource.java +++ b/src/com/vaadin/terminal/ThemeResource.java @@ -89,6 +89,7 @@ public class ThemeResource implements Resource { /** * @see com.vaadin.terminal.Resource#getMIMEType() */ + @Override public String getMIMEType() { return FileTypeResolver.getMIMEType(getResourceId()); } diff --git a/src/com/vaadin/terminal/gwt/client/AbstractFieldState.java b/src/com/vaadin/terminal/gwt/client/AbstractFieldState.java index 3a66a01f23..6a869893f7 100644 --- a/src/com/vaadin/terminal/gwt/client/AbstractFieldState.java +++ b/src/com/vaadin/terminal/gwt/client/AbstractFieldState.java @@ -121,6 +121,7 @@ public class AbstractFieldState extends ComponentState implements TabIndexState * * @see com.vaadin.terminal.gwt.client.ComponentState#getTabIndex() */ + @Override public int getTabIndex() { return tabIndex; } @@ -130,6 +131,7 @@ public class AbstractFieldState extends ComponentState implements TabIndexState * * @see com.vaadin.terminal.gwt.client.ui.TabIndexState#setTabIndex(int) */ + @Override public void setTabIndex(int tabIndex) { this.tabIndex = tabIndex; } diff --git a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java index 31775d1d02..877f2a70b8 100644 --- a/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java +++ b/src/com/vaadin/terminal/gwt/client/ApplicationConfiguration.java @@ -348,6 +348,7 @@ public class ApplicationConfiguration implements EntryPoint { public static void startApplication(final String applicationId) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { ApplicationConfiguration appConf = getConfigFromDOM(applicationId); ApplicationConnection a = GWT @@ -553,6 +554,7 @@ public class ApplicationConfiguration implements EntryPoint { private static DeferredWidgetLoader deferredWidgetLoader; + @Override public void onModuleLoad() { // Prepare VConsole for debugging @@ -571,6 +573,7 @@ public class ApplicationConfiguration implements EntryPoint { */ GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler() { + @Override public void onUncaughtException(Throwable e) { /* * Note in case of null console (without ?debug) we eat diff --git a/src/com/vaadin/terminal/gwt/client/ComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ComponentConnector.java index 95e9a4cf78..1da73edcf6 100644 --- a/src/com/vaadin/terminal/gwt/client/ComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ComponentConnector.java @@ -22,6 +22,7 @@ public interface ComponentConnector extends ServerConnector { * * @see com.vaadin.terminal.gwt.client.VPaintable#getState() */ + @Override public ComponentState getState(); /** diff --git a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java index 2b88867cfe..5e15bae48a 100644 --- a/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java +++ b/src/com/vaadin/terminal/gwt/client/JavaScriptConnectorHelper.java @@ -49,6 +49,7 @@ public class JavaScriptConnectorHelper { public void init() { connector.addStateChangeHandler(new StateChangeHandler() { + @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { JavaScriptObject wrapper = getConnectorWrapper(); JavaScriptConnectorState state = getConnectorState(); diff --git a/src/com/vaadin/terminal/gwt/client/JavaScriptExtension.java b/src/com/vaadin/terminal/gwt/client/JavaScriptExtension.java index 2a97e4a770..6fa9904230 100644 --- a/src/com/vaadin/terminal/gwt/client/JavaScriptExtension.java +++ b/src/com/vaadin/terminal/gwt/client/JavaScriptExtension.java @@ -21,6 +21,7 @@ public final class JavaScriptExtension extends AbstractExtensionConnector helper.init(); } + @Override public JavaScriptConnectorHelper getJavascriptConnectorHelper() { return helper; } diff --git a/src/com/vaadin/terminal/gwt/client/JavaScriptExtensionState.java b/src/com/vaadin/terminal/gwt/client/JavaScriptExtensionState.java index e7bfbc4bb2..82fcc51f8a 100644 --- a/src/com/vaadin/terminal/gwt/client/JavaScriptExtensionState.java +++ b/src/com/vaadin/terminal/gwt/client/JavaScriptExtensionState.java @@ -18,6 +18,7 @@ public class JavaScriptExtensionState extends SharedState implements private Set callbackNames = new HashSet(); private Map> rpcInterfaces = new HashMap>(); + @Override public Set getCallbackNames() { return callbackNames; } @@ -26,6 +27,7 @@ public class JavaScriptExtensionState extends SharedState implements this.callbackNames = callbackNames; } + @Override public Map> getRpcInterfaces() { return rpcInterfaces; } diff --git a/src/com/vaadin/terminal/gwt/client/NullConsole.java b/src/com/vaadin/terminal/gwt/client/NullConsole.java index 2d15ffd46c..7db513ca82 100644 --- a/src/com/vaadin/terminal/gwt/client/NullConsole.java +++ b/src/com/vaadin/terminal/gwt/client/NullConsole.java @@ -15,39 +15,48 @@ import com.google.gwt.core.client.GWT; */ public class NullConsole implements Console { + @Override public void dirUIDL(ValueMap u, ApplicationConfiguration cnf) { } + @Override public void error(String msg) { GWT.log(msg); } + @Override public void log(String msg) { GWT.log(msg); } + @Override public void printObject(Object msg) { GWT.log(msg.toString()); } + @Override public void printLayoutProblems(ValueMap meta, ApplicationConnection applicationConnection, Set zeroHeightComponents, Set zeroWidthComponents) { } + @Override public void log(Throwable e) { GWT.log(e.getMessage(), e); } + @Override public void error(Throwable e) { // Borrow exception handling from VDebugConsole VDebugConsole.handleError(e, this); } + @Override public void setQuietMode(boolean quietDebugMode) { } + @Override public void init() { } diff --git a/src/com/vaadin/terminal/gwt/client/ResourceLoader.java b/src/com/vaadin/terminal/gwt/client/ResourceLoader.java index 8c481e0356..21577ce87e 100644 --- a/src/com/vaadin/terminal/gwt/client/ResourceLoader.java +++ b/src/com/vaadin/terminal/gwt/client/ResourceLoader.java @@ -206,10 +206,12 @@ public class ResourceLoader { if (preloadListeners.containsKey(url)) { // Preload going on, continue when preloaded preloadResource(url, new ResourceLoadListener() { + @Override public void onLoad(ResourceLoadEvent event) { loadScript(url, resourceLoadListener); } + @Override public void onError(ResourceLoadEvent event) { // Preload failed -> signal error to own listener if (resourceLoadListener != null) { @@ -225,10 +227,12 @@ public class ResourceLoader { scriptTag.setSrc(url); scriptTag.setType("text/javascript"); addOnloadHandler(scriptTag, new ResourceLoadListener() { + @Override public void onLoad(ResourceLoadEvent event) { fireLoad(event); } + @Override public void onError(ResourceLoadEvent event) { fireError(event); } @@ -280,10 +284,12 @@ public class ResourceLoader { Element element = getPreloadElement(url); addOnloadHandler(element, new ResourceLoadListener() { + @Override public void onLoad(ResourceLoadEvent event) { fireLoad(event); } + @Override public void onError(ResourceLoadEvent event) { fireError(event); } @@ -358,10 +364,12 @@ public class ResourceLoader { if (preloadListeners.containsKey(url)) { // Preload going on, continue when preloaded preloadResource(url, new ResourceLoadListener() { + @Override public void onLoad(ResourceLoadEvent event) { loadStylesheet(url, resourceLoadListener); } + @Override public void onError(ResourceLoadEvent event) { // Preload failed -> signal error to own listener if (resourceLoadListener != null) { @@ -384,6 +392,7 @@ public class ResourceLoader { Scheduler.get().scheduleFixedPeriod(new RepeatingCommand() { private final Duration duration = new Duration(); + @Override public boolean execute() { int styleSheetLength = getStyleSheetLength(url); if (getStyleSheetLength(url) > 0) { @@ -403,6 +412,7 @@ public class ResourceLoader { }, 10); } else { addOnloadHandler(linkElement, new ResourceLoadListener() { + @Override public void onLoad(ResourceLoadEvent event) { // Chrome && IE fires load for errors, must check // stylesheet data @@ -418,6 +428,7 @@ public class ResourceLoader { fireLoad(event); } + @Override public void onError(ResourceLoadEvent event) { fireError(event); } diff --git a/src/com/vaadin/terminal/gwt/client/ServerConnector.java b/src/com/vaadin/terminal/gwt/client/ServerConnector.java index 3809073076..b016e2e88c 100644 --- a/src/com/vaadin/terminal/gwt/client/ServerConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ServerConnector.java @@ -93,6 +93,7 @@ public interface ServerConnector extends Connector { * @return The parent of this connector, as set by * {@link #setParent(ServerConnector)}. */ + @Override public ServerConnector getParent(); /** diff --git a/src/com/vaadin/terminal/gwt/client/SimpleTree.java b/src/com/vaadin/terminal/gwt/client/SimpleTree.java index 350e0d707d..506d990aac 100644 --- a/src/com/vaadin/terminal/gwt/client/SimpleTree.java +++ b/src/com/vaadin/terminal/gwt/client/SimpleTree.java @@ -49,6 +49,7 @@ public class SimpleTree extends ComplexPanel { getElement().appendChild(children); addDomHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { if (event.getNativeEvent().getEventTarget().cast() == handle) { if (children.getStyle().getDisplay().intern() == Display.NONE diff --git a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java index 02df811d51..e435b3c6ed 100644 --- a/src/com/vaadin/terminal/gwt/client/SuperDevMode.java +++ b/src/com/vaadin/terminal/gwt/client/SuperDevMode.java @@ -53,6 +53,7 @@ public class SuperDevMode { + getRecompileParameters(GWT.getModuleName()), new AsyncCallback() { + @Override public void onSuccess(RecompileResult result) { VConsole.log("JSONP compile call successful"); @@ -72,6 +73,7 @@ public class SuperDevMode { Location.reload(); } + @Override public void onFailure(Throwable caught) { VConsole.error("JSONP compile call failed"); // Don't log exception as they are shown as @@ -86,6 +88,7 @@ public class SuperDevMode { VNotification n = new VNotification(); n.addEventListener(new EventListener() { + @Override public void notificationHidden(HideEvent event) { recompileWidgetsetAndStartInDevMode(serverUrl); } diff --git a/src/com/vaadin/terminal/gwt/client/UIDL.java b/src/com/vaadin/terminal/gwt/client/UIDL.java index a523016b60..e662e08b3f 100644 --- a/src/com/vaadin/terminal/gwt/client/UIDL.java +++ b/src/com/vaadin/terminal/gwt/client/UIDL.java @@ -283,10 +283,12 @@ public final class UIDL extends JavaScriptObject { int index = -1; + @Override public void remove() { throw new UnsupportedOperationException(); } + @Override public Object next() { if (hasNext()) { @@ -308,6 +310,7 @@ public final class UIDL extends JavaScriptObject { return null; } + @Override public boolean hasNext() { int count = getChildCount(); return count > index + 1; diff --git a/src/com/vaadin/terminal/gwt/client/Util.java b/src/com/vaadin/terminal/gwt/client/Util.java index 4687512b47..1bda2401f0 100644 --- a/src/com/vaadin/terminal/gwt/client/Util.java +++ b/src/com/vaadin/terminal/gwt/client/Util.java @@ -447,6 +447,7 @@ public class Util { elem.getStyle().setProperty("overflow", "hidden"); Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { // Dough, Safari scroll auto means actually just a moped elem.getStyle().setProperty("overflow", originalOverflow); @@ -1021,6 +1022,7 @@ public class Util { } Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { try { target.dispatchEvent(createMouseDownEvent); diff --git a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java index ce893741d3..a7bd943912 100644 --- a/src/com/vaadin/terminal/gwt/client/VDebugConsole.java +++ b/src/com/vaadin/terminal/gwt/client/VDebugConsole.java @@ -84,6 +84,7 @@ public class VDebugConsole extends VOverlay implements Console { this.label = label; } + @Override public void onPreviewNativeEvent(NativePreviewEvent event) { if (event.getTypeInt() == Event.ONKEYDOWN && event.getNativeEvent().getKeyCode() == KeyCodes.KEY_ESCAPE) { @@ -199,6 +200,7 @@ public class VDebugConsole extends VOverlay implements Console { private EventPreview dragpreview = new EventPreview() { + @Override public boolean onEventPreview(Event event) { onBrowserEvent(event); return false; @@ -346,6 +348,7 @@ public class VDebugConsole extends VOverlay implements Console { * * @see com.vaadin.terminal.gwt.client.Console#log(java.lang.String) */ + @Override public void log(String msg) { if (msg == null) { msg = "null"; @@ -362,6 +365,7 @@ public class VDebugConsole extends VOverlay implements Console { private List msgQueue = new LinkedList(); private ScheduledCommand doSend = new ScheduledCommand() { + @Override public void execute() { if (!msgQueue.isEmpty()) { RequestBuilder requestBuilder = new RequestBuilder( @@ -375,12 +379,14 @@ public class VDebugConsole extends VOverlay implements Console { requestBuilder.sendRequest(requestData, new RequestCallback() { + @Override public void onResponseReceived(Request request, Response response) { // TODO Auto-generated method stub } + @Override public void onError(Request request, Throwable exception) { // TODO Auto-generated method stub @@ -438,6 +444,7 @@ public class VDebugConsole extends VOverlay implements Console { * * @see com.vaadin.terminal.gwt.client.Console#error(java.lang.String) */ + @Override public void error(String msg) { if (msg == null) { msg = "null"; @@ -466,6 +473,7 @@ public class VDebugConsole extends VOverlay implements Console { * @see com.vaadin.terminal.gwt.client.Console#printObject(java.lang. * Object) */ + @Override public void printObject(Object msg) { String str; if (msg == null) { @@ -483,6 +491,7 @@ public class VDebugConsole extends VOverlay implements Console { * @see com.vaadin.terminal.gwt.client.Console#dirUIDL(com.vaadin * .terminal.gwt.client.UIDL) */ + @Override public void dirUIDL(ValueMap u, ApplicationConfiguration conf) { if (panel.isAttached()) { VUIDLBrowser vuidlBrowser = new VUIDLBrowser(u, conf); @@ -522,6 +531,7 @@ public class VDebugConsole extends VOverlay implements Console { } }-*/; + @Override public void printLayoutProblems(ValueMap meta, ApplicationConnection ac, Set zeroHeightComponents, Set zeroWidthComponents) { @@ -576,6 +586,7 @@ public class VDebugConsole extends VOverlay implements Console { final CheckBox emphasisInUi = new CheckBox( "Emphasize components parent in UI (the actual component is not visible)"); emphasisInUi.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { Element element2 = layout.getElement(); Widget.setStyleName(element2, "invalidlayout", @@ -609,6 +620,7 @@ public class VDebugConsole extends VOverlay implements Console { } final CheckBox emphasisInUi = new CheckBox("Emphasize component in UI"); emphasisInUi.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { if (paintable != null) { Element element2 = paintable.getWidget().getElement(); @@ -634,6 +646,7 @@ public class VDebugConsole extends VOverlay implements Console { root.add(errorNode); } + @Override public void log(Throwable e) { if (e instanceof UmbrellaException) { UmbrellaException ue = (UmbrellaException) e; @@ -646,6 +659,7 @@ public class VDebugConsole extends VOverlay implements Console { GWT.log(e.getMessage(), e); } + @Override public void error(Throwable e) { handleError(e, this); } @@ -677,6 +691,7 @@ public class VDebugConsole extends VOverlay implements Console { } } + @Override public void init() { panel = new FlowPanel(); if (!quietMode) { @@ -732,6 +747,7 @@ public class VDebugConsole extends VOverlay implements Console { panel.add(new HTML("" + help + "")); clear.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { int width = panel.getOffsetWidth(); int height = panel.getOffsetHeight(); @@ -744,6 +760,7 @@ public class VDebugConsole extends VOverlay implements Console { }); restart.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { String queryString = Window.Location.getQueryString(); @@ -771,6 +788,7 @@ public class VDebugConsole extends VOverlay implements Console { }); forceLayout.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { for (ApplicationConnection applicationConnection : ApplicationConfiguration .getRunningApplications()) { @@ -780,6 +798,7 @@ public class VDebugConsole extends VOverlay implements Console { }); analyzeLayout.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { List runningApplications = ApplicationConfiguration .getRunningApplications(); @@ -795,6 +814,7 @@ public class VDebugConsole extends VOverlay implements Console { + " all non committed variables form client side."); savePosition.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { String pos = getAbsoluteLeft() + "," + getAbsoluteTop() + "," + getOffsetWidth() + "," + getOffsetHeight() @@ -805,6 +825,7 @@ public class VDebugConsole extends VOverlay implements Console { highlight.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { final Label label = new Label("--"); log("Use mouse to select a component or click ESC to exit highlight mode."); @@ -819,6 +840,7 @@ public class VDebugConsole extends VOverlay implements Console { } connectorStats.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { for (ApplicationConnection a : ApplicationConfiguration .getRunningApplications()) { @@ -851,6 +873,7 @@ public class VDebugConsole extends VOverlay implements Console { } superDevMode.addValueChangeHandler(new ValueChangeHandler() { + @Override public void onValueChange(ValueChangeEvent event) { SuperDevMode.redirect(event.getValue()); } @@ -865,6 +888,7 @@ public class VDebugConsole extends VOverlay implements Console { devMode.setValue(true); } devMode.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { if (devMode.getValue()) { addHMParameter(); @@ -951,6 +975,7 @@ public class VDebugConsole extends VOverlay implements Console { } }; simpleTree.addDomHandler(new MouseOutHandler() { + @Override public void onMouseOut(MouseOutEvent event) { VUIDLBrowser.deHiglight(); } @@ -972,6 +997,7 @@ public class VDebugConsole extends VOverlay implements Console { return Util.getConnectorString(connector); } + @Override public void setQuietMode(boolean quietDebugMode) { quietMode = quietDebugMode; } diff --git a/src/com/vaadin/terminal/gwt/client/VSchedulerImpl.java b/src/com/vaadin/terminal/gwt/client/VSchedulerImpl.java index 65d5d6a9a2..6f5e5854b2 100644 --- a/src/com/vaadin/terminal/gwt/client/VSchedulerImpl.java +++ b/src/com/vaadin/terminal/gwt/client/VSchedulerImpl.java @@ -19,6 +19,7 @@ public class VSchedulerImpl extends SchedulerImpl { super.scheduleDeferred(cmd); super.scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { deferredCommandTrackers--; } diff --git a/src/com/vaadin/terminal/gwt/client/VTooltip.java b/src/com/vaadin/terminal/gwt/client/VTooltip.java index 7fd3a3238b..38d1235c69 100644 --- a/src/com/vaadin/terminal/gwt/client/VTooltip.java +++ b/src/com/vaadin/terminal/gwt/client/VTooltip.java @@ -82,6 +82,7 @@ public class VTooltip extends VOverlay { // first to 0,0 position so that the calculation goes correctly. setPopupPosition(0, 0); setPopupPositionAndShow(new PositionCallback() { + @Override public void setPosition(int offsetWidth, int offsetHeight) { if (offsetWidth > MAX_WIDTH) { @@ -294,6 +295,7 @@ public class VTooltip extends VOverlay { currentTooltipInfo = null; } + @Override public void onMouseMove(MouseMoveEvent mme) { Event event = Event.as(mme.getNativeEvent()); com.google.gwt.dom.client.Element element = Element.as(event @@ -322,10 +324,12 @@ public class VTooltip extends VOverlay { } } + @Override public void onClick(ClickEvent event) { handleHideEvent(); } + @Override public void onKeyDown(KeyDownEvent event) { handleHideEvent(); } diff --git a/src/com/vaadin/terminal/gwt/client/WidgetLoader.java b/src/com/vaadin/terminal/gwt/client/WidgetLoader.java index 491e569411..749a8343c8 100644 --- a/src/com/vaadin/terminal/gwt/client/WidgetLoader.java +++ b/src/com/vaadin/terminal/gwt/client/WidgetLoader.java @@ -8,10 +8,12 @@ import com.google.gwt.core.client.RunAsyncCallback; /** A helper class used by WidgetMap implementation. Used by the generated code. */ abstract class WidgetLoader implements RunAsyncCallback { + @Override public void onFailure(Throwable reason) { ApplicationConfiguration.endDependencyLoading(); } + @Override public void onSuccess() { addInstantiator(); ApplicationConfiguration.endDependencyLoading(); diff --git a/src/com/vaadin/terminal/gwt/client/communication/URLReference_Serializer.java b/src/com/vaadin/terminal/gwt/client/communication/URLReference_Serializer.java index bab0f385ed..8a7d5f2b69 100644 --- a/src/com/vaadin/terminal/gwt/client/communication/URLReference_Serializer.java +++ b/src/com/vaadin/terminal/gwt/client/communication/URLReference_Serializer.java @@ -13,6 +13,7 @@ public class URLReference_Serializer implements JSONSerializer { // setURL() -> uRL as first char becomes lower case... private static final String URL_FIELD = "uRL"; + @Override public URLReference deserialize(Type type, JSONValue jsonValue, ApplicationConnection connection) { URLReference reference = GWT.create(URLReference.class); @@ -27,6 +28,7 @@ public class URLReference_Serializer implements JSONSerializer { return reference; } + @Override public JSONValue serialize(URLReference value, ApplicationConnection connection) { JSONObject json = new JSONObject(); diff --git a/src/com/vaadin/terminal/gwt/client/extensions/javascriptmanager/JavaScriptManagerConnector.java b/src/com/vaadin/terminal/gwt/client/extensions/javascriptmanager/JavaScriptManagerConnector.java index 8656783a86..49eb198e13 100644 --- a/src/com/vaadin/terminal/gwt/client/extensions/javascriptmanager/JavaScriptManagerConnector.java +++ b/src/com/vaadin/terminal/gwt/client/extensions/javascriptmanager/JavaScriptManagerConnector.java @@ -23,6 +23,7 @@ public class JavaScriptManagerConnector extends AbstractExtensionConnector { @Override protected void init() { registerRpc(ExecuteJavaScriptRpc.class, new ExecuteJavaScriptRpc() { + @Override public void executeJavaScript(String Script) { eval(Script); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractClickEventHandler.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractClickEventHandler.java index e0ca798682..9de465e4a5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractClickEventHandler.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractClickEventHandler.java @@ -53,6 +53,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, */ private final NativePreviewHandler mouseUpPreviewHandler = new NativePreviewHandler() { + @Override public void onPreviewNativeEvent(NativePreviewEvent event) { if (event.getTypeInt() == Event.ONMOUSEUP) { mouseUpEventPreviewRegistration.removeHandler(); @@ -144,6 +145,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, * popping up if there is a listener for right clicks. */ + @Override public void onContextMenu(ContextMenuEvent event) { if (hasEventListener() && shouldFireEvent(event)) { // Prevent showing the browser's context menu when there is a right @@ -152,6 +154,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, } } + @Override public void onMouseDown(MouseDownEvent event) { /* * When getting a mousedown event, we must detect where the @@ -163,6 +166,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, .addNativePreviewHandler(mouseUpPreviewHandler); } + @Override public void onMouseUp(MouseUpEvent event) { /* * Only fire a click if the mouseup hits the same element as the @@ -208,6 +212,7 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, * double click will result in two click events and one double click event. */ + @Override public void onDoubleClick(DoubleClickEvent event) { if (hasEventListener() && shouldFireEvent(event)) { fireClick(event.getNativeEvent()); diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java index 6105c545f6..e95d4ca280 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentConnector.java @@ -73,6 +73,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * * @return The widget associated with this paintable */ + @Override public Widget getWidget() { if (widget == null) { widget = createWidget(); @@ -138,6 +139,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector updateComponentSize(); } + @Override public void setWidgetEnabled(boolean widgetEnabled) { // add or remove v-disabled style name from the widget setWidgetStyleName(ApplicationConnection.DISABLED_CLASSNAME, @@ -196,18 +198,22 @@ public abstract class AbstractComponentConnector extends AbstractConnector widget.setWidth(newWidth); } + @Override public boolean isRelativeHeight() { return getState().getHeight().endsWith("%"); } + @Override public boolean isRelativeWidth() { return getState().getWidth().endsWith("%"); } + @Override public boolean isUndefinedHeight() { return getState().getHeight().length() == 0; } + @Override public boolean isUndefinedWidth() { return getState().getWidth().length() == 0; } @@ -219,6 +225,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * com.vaadin.terminal.gwt.client.ComponentConnector#delegateCaptionHandling * () */ + @Override public boolean delegateCaptionHandling() { return true; } @@ -337,11 +344,13 @@ public abstract class AbstractComponentConnector extends AbstractConnector * * @see com.vaadin.terminal.gwt.client.ComponentConnector#isReadOnly() */ + @Override @Deprecated public boolean isReadOnly() { return getState().isReadOnly(); } + @Override public LayoutManager getLayoutManager() { return LayoutManager.get(getConnection()); } @@ -355,6 +364,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * @return true if an event listener has been registered with the given * event identifier on the server side, false otherwise */ + @Override public boolean hasEventListener(String eventIdentifier) { Set reg = getState().getRegisteredEventListeners(); return (reg != null && reg.contains(eventIdentifier)); @@ -388,6 +398,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector * com.vaadin.terminal.gwt.client.ComponentConnector#getTooltipInfo(com. * google.gwt.dom.client.Element) */ + @Override public TooltipInfo getTooltipInfo(Element element) { return new TooltipInfo(getState().getDescription(), getState() .getErrorMessage()); diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentContainerConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentContainerConnector.java index c6bfba5023..6b294e65b8 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentContainerConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractComponentContainerConnector.java @@ -35,6 +35,7 @@ public abstract class AbstractComponentContainerConnector extends * @see * com.vaadin.terminal.gwt.client.ComponentContainerConnector#getChildren() */ + @Override public List getChildComponents() { if (childComponents == null) { return Collections.emptyList(); @@ -50,6 +51,7 @@ public abstract class AbstractComponentContainerConnector extends * com.vaadin.terminal.gwt.client.ComponentContainerConnector#setChildren * (java.util.Collection) */ + @Override public void setChildComponents(List childComponents) { this.childComponents = childComponents; } @@ -61,6 +63,7 @@ public abstract class AbstractComponentContainerConnector extends * connectorHierarchyChanged * (com.vaadin.terminal.gwt.client.ConnectorHierarchyChangedEvent) */ + @Override public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { if (debugLogging) { VConsole.log("Hierarchy changed for " @@ -79,6 +82,7 @@ public abstract class AbstractComponentContainerConnector extends } } + @Override public HandlerRegistration addConnectorHierarchyChangeHandler( ConnectorHierarchyChangeHandler handler) { return ensureHandlerManager().addHandler( diff --git a/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java b/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java index bee9c75165..f4e78a39f4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/AbstractConnector.java @@ -57,6 +57,7 @@ public abstract class AbstractConnector implements ServerConnector, * * @see com.vaadin.terminal.gwt.client.VPaintable#getConnection() */ + @Override public final ApplicationConnection getConnection() { return connection; } @@ -66,6 +67,7 @@ public abstract class AbstractConnector implements ServerConnector, * * @see com.vaadin.terminal.gwt.client.Connector#getId() */ + @Override public String getConnectorId() { return id; } @@ -78,6 +80,7 @@ public abstract class AbstractConnector implements ServerConnector, *

    * Connector classes should override {@link #init()} instead of this method. */ + @Override public final void doInit(String connectorId, ApplicationConnection connection) { this.connection = connection; @@ -140,6 +143,7 @@ public abstract class AbstractConnector implements ServerConnector, } } + @Override public Collection getRpcImplementations( String rpcInterfaceId) { if (null == rpcImplementations) { @@ -148,6 +152,7 @@ public abstract class AbstractConnector implements ServerConnector, return (Collection) rpcImplementations.get(rpcInterfaceId); } + @Override public void fireEvent(GwtEvent event) { if (handlerManager != null) { handlerManager.fireEvent(event); @@ -162,11 +167,13 @@ public abstract class AbstractConnector implements ServerConnector, return handlerManager; } + @Override public HandlerRegistration addStateChangeHandler(StateChangeHandler handler) { return ensureHandlerManager() .addHandler(StateChangeEvent.TYPE, handler); } + @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { if (debugLogging) { VConsole.log("State change event for " @@ -182,6 +189,7 @@ public abstract class AbstractConnector implements ServerConnector, * * @see com.vaadin.terminal.gwt.client.ServerConnector#onUnregister() */ + @Override public void onUnregister() { if (debugLogging) { VConsole.log("Unregistered connector " @@ -197,6 +205,7 @@ public abstract class AbstractConnector implements ServerConnector, * * @return the current shared state (never null) */ + @Override public SharedState getState() { if (state == null) { state = createState(); @@ -217,14 +226,17 @@ public abstract class AbstractConnector implements ServerConnector, return ConnectorStateFactory.createState(getClass()); } + @Override public ServerConnector getParent() { return parent; } + @Override public void setParent(ServerConnector parent) { this.parent = parent; } + @Override public List getChildren() { if (children == null) { return Collections.emptyList(); @@ -232,10 +244,12 @@ public abstract class AbstractConnector implements ServerConnector, return children; } + @Override public void setChildren(List children) { this.children = children; } + @Override public boolean isEnabled() { if (!getState().isEnabled()) { return false; @@ -248,6 +262,7 @@ public abstract class AbstractConnector implements ServerConnector, } } + @Override public void updateEnabledState(boolean enabledState) { if (lastEnabledState == enabledState) { return; diff --git a/src/com/vaadin/terminal/gwt/client/ui/Action.java b/src/com/vaadin/terminal/gwt/client/ui/Action.java index ca13cfc7f3..1a92e30f3f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/Action.java +++ b/src/com/vaadin/terminal/gwt/client/ui/Action.java @@ -25,6 +25,7 @@ public abstract class Action implements Command { /** * Executed when action fired */ + @Override public abstract void execute(); public String getHTML() { diff --git a/src/com/vaadin/terminal/gwt/client/ui/ConnectorWidgetFactory.java b/src/com/vaadin/terminal/gwt/client/ui/ConnectorWidgetFactory.java index 063d9f03a1..03d2069a94 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/ConnectorWidgetFactory.java +++ b/src/com/vaadin/terminal/gwt/client/ui/ConnectorWidgetFactory.java @@ -15,6 +15,7 @@ public abstract class ConnectorWidgetFactory extends // TODO Move to generator { addCreator(TextFieldConnector.class, new Creator() { + @Override public Widget create() { return GWT.create(VTextField.class); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/FocusableFlexTable.java b/src/com/vaadin/terminal/gwt/client/ui/FocusableFlexTable.java index fc97bafc46..2fac234587 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FocusableFlexTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FocusableFlexTable.java @@ -42,6 +42,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasFocusHandlers#addFocusHandler(com. * google.gwt.event.dom.client.FocusHandler) */ + @Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return addDomHandler(handler, FocusEvent.getType()); } @@ -53,6 +54,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasBlurHandlers#addBlurHandler(com.google * .gwt.event.dom.client.BlurHandler) */ + @Override public HandlerRegistration addBlurHandler(BlurHandler handler) { return addDomHandler(handler, BlurEvent.getType()); } @@ -64,6 +66,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler( * com.google.gwt.event.dom.client.KeyDownHandler) */ + @Override public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { return addDomHandler(handler, KeyDownEvent.getType()); } @@ -75,6 +78,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasKeyPressHandlers#addKeyPressHandler * (com.google.gwt.event.dom.client.KeyPressHandler) */ + @Override public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) { return addDomHandler(handler, KeyPressEvent.getType()); } @@ -99,6 +103,7 @@ public class FocusableFlexTable extends FlexTable implements HasFocusHandlers, * * @see com.vaadin.terminal.gwt.client.Focusable#focus() */ + @Override public void focus() { setFocus(true); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/FocusableFlowPanel.java b/src/com/vaadin/terminal/gwt/client/ui/FocusableFlowPanel.java index 831add049b..258fe441af 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FocusableFlowPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FocusableFlowPanel.java @@ -39,6 +39,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasFocusHandlers#addFocusHandler(com. * google.gwt.event.dom.client.FocusHandler) */ + @Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return addDomHandler(handler, FocusEvent.getType()); } @@ -50,6 +51,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasBlurHandlers#addBlurHandler(com.google * .gwt.event.dom.client.BlurHandler) */ + @Override public HandlerRegistration addBlurHandler(BlurHandler handler) { return addDomHandler(handler, BlurEvent.getType()); } @@ -61,6 +63,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler( * com.google.gwt.event.dom.client.KeyDownHandler) */ + @Override public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { return addDomHandler(handler, KeyDownEvent.getType()); } @@ -72,6 +75,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, * com.google.gwt.event.dom.client.HasKeyPressHandlers#addKeyPressHandler * (com.google.gwt.event.dom.client.KeyPressHandler) */ + @Override public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) { return addDomHandler(handler, KeyPressEvent.getType()); } @@ -94,6 +98,7 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, /** * Focus the panel */ + @Override public void focus() { setFocus(true); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java b/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java index ef1ea8521b..0ba42eb861 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/FocusableScrollPanel.java @@ -110,6 +110,7 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements } } + @Override public HandlerRegistration addScrollHandler(ScrollHandler handler) { return addDomHandler(handler, ScrollEvent.getType()); } @@ -168,8 +169,10 @@ public class FocusableScrollPanel extends SimpleFocusablePanel implements } } + @Override public void onScroll(ScrollEvent event) { Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { focusElement.getStyle().setTop(getScrollPosition(), Unit.PX); focusElement.getStyle().setLeft(getHorizontalScrollPosition(), diff --git a/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentConnector.java index bb062a6677..b317618878 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentConnector.java @@ -31,6 +31,7 @@ public final class JavaScriptComponentConnector extends helper.init(); } + @Override public JavaScriptConnectorHelper getJavascriptConnectorHelper() { return helper; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentState.java b/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentState.java index 6728f85ec9..6675ac69a4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentState.java +++ b/src/com/vaadin/terminal/gwt/client/ui/JavaScriptComponentState.java @@ -18,6 +18,7 @@ public class JavaScriptComponentState extends ComponentState implements private Set callbackNames = new HashSet(); private Map> rpcInterfaces = new HashMap>(); + @Override public Set getCallbackNames() { return callbackNames; } @@ -26,6 +27,7 @@ public class JavaScriptComponentState extends ComponentState implements this.callbackNames = callbackNames; } + @Override public Map> getRpcInterfaces() { return rpcInterfaces; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java b/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java index 42027f911b..81d963f981 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/MediaBaseConnector.java @@ -32,10 +32,12 @@ public abstract class MediaBaseConnector extends AbstractComponentConnector { super.init(); registerRpc(MediaControl.class, new MediaControl() { + @Override public void play() { getWidget().play(); } + @Override public void pause() { getWidget().pause(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java b/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java index 37e9ab4a69..40454345bc 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java +++ b/src/com/vaadin/terminal/gwt/client/ui/ShortcutActionHandler.java @@ -149,6 +149,7 @@ public class ShortcutActionHandler { } else { shakeTarget(et); Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { shakeTarget(et); } @@ -156,6 +157,7 @@ public class ShortcutActionHandler { } Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { if (finalTarget != null) { client.updateVariable(paintableId, "actiontarget", @@ -187,6 +189,7 @@ public class ShortcutActionHandler { // deferred. Will cause a small flickering, so not doing it for all // browsers. Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { focus(e); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java b/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java index 9baa1db007..ec62b82ce1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/SimpleFocusablePanel.java @@ -36,18 +36,22 @@ public class SimpleFocusablePanel extends SimplePanel implements setTabIndex(0); } + @Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return addDomHandler(handler, FocusEvent.getType()); } + @Override public HandlerRegistration addBlurHandler(BlurHandler handler) { return addDomHandler(handler, BlurEvent.getType()); } + @Override public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { return addDomHandler(handler, KeyDownEvent.getType()); } + @Override public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) { return addDomHandler(handler, KeyPressEvent.getType()); } @@ -64,6 +68,7 @@ public class SimpleFocusablePanel extends SimplePanel implements } } + @Override public void focus() { setFocus(true); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java b/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java index 7302f9f2ac..16c32acecc 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/TouchScrollDelegate.java @@ -121,6 +121,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { setElements(scrollables); } + @Override public void onTouchStart(TouchStartEvent event) { assert delegate != null; delegate.onTouchStart(event); @@ -593,6 +594,7 @@ public class TouchScrollDelegate implements NativePreviewHandler { - scrolledElement.getClientHeight(); } + @Override public void onPreviewNativeEvent(NativePreviewEvent event) { int typeInt = event.getTypeInt(); if (transitionOn) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/TreeImages.java b/src/com/vaadin/terminal/gwt/client/ui/TreeImages.java index 37f8889463..221a409511 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/TreeImages.java +++ b/src/com/vaadin/terminal/gwt/client/ui/TreeImages.java @@ -15,6 +15,7 @@ public interface TreeImages extends com.google.gwt.user.client.ui.TreeImages { * @gwt.resource com/vaadin/terminal/gwt/public/default/tree/img/expanded * .png */ + @Override AbstractImagePrototype treeOpen(); /** @@ -24,6 +25,7 @@ public interface TreeImages extends com.google.gwt.user.client.ui.TreeImages { * @gwt.resource com/vaadin/terminal/gwt/public/default/tree/img/collapsed * .png */ + @Override AbstractImagePrototype treeClosed(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java b/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java index 692e13bd94..607abe893a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VContextMenu.java @@ -46,6 +46,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor(100, new ScheduledCommand() { + @Override public void execute() { imagesLoaded(); } @@ -103,6 +104,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { Util.sinkOnloadForImages(menu.getElement()); setPopupPositionAndShow(new PositionCallback() { + @Override public void setPosition(int offsetWidth, int offsetHeight) { // mac FF gets bad width due GWT popups overflow hacks, // re-determine width @@ -129,6 +131,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { * the positioning has been done. */ Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { // Focus the menu. menu.setFocus(true); @@ -186,18 +189,22 @@ public class VContextMenu extends VOverlay implements SubPartAware { return super.getItems().get(index); } + @Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return addDomHandler(handler, FocusEvent.getType()); } + @Override public HandlerRegistration addBlurHandler(BlurHandler handler) { return addDomHandler(handler, BlurEvent.getType()); } + @Override public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { return addDomHandler(handler, KeyDownEvent.getType()); } + @Override public HandlerRegistration addKeyPressHandler(KeyPressHandler handler) { return addDomHandler(handler, KeyPressEvent.getType()); } @@ -215,6 +222,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { setFocus(true); } + @Override public void onLoad(LoadEvent event) { // Handle icon onload events to ensure shadow is resized correctly delayedImageLoadExecutioner.trigger(); @@ -222,6 +230,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { } + @Override public Element getSubPartElement(String subPart) { int index = Integer.parseInt(subPart.substring(6)); // ApplicationConnection.getConsole().log( @@ -232,6 +241,7 @@ public class VContextMenu extends VOverlay implements SubPartAware { return item.getElement().getFirstChildElement().cast(); } + @Override public String getSubPartName(Element subElement) { if (getElement().isOrHasChild(subElement)) { com.google.gwt.dom.client.Element e = subElement; diff --git a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java index 77639c0c3f..a6ef85dcf1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java +++ b/src/com/vaadin/terminal/gwt/client/ui/VOverlay.java @@ -372,6 +372,7 @@ public class VOverlay extends PopupPanel implements CloseHandler { } } + @Override public void onClose(CloseEvent event) { removeShadowIfPresent(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java b/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java index 7fccdafd2a..f2f0125c86 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/Vaadin6Connector.java @@ -10,6 +10,7 @@ import com.vaadin.terminal.gwt.client.UIDL; public abstract class Vaadin6Connector extends AbstractComponentConnector implements Paintable { + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { ((Paintable) getWidget()).updateFromUIDL(uidl, client); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/absolutelayout/AbsoluteLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/absolutelayout/AbsoluteLayoutConnector.java index 91436f5353..5675f9459e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/absolutelayout/AbsoluteLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/absolutelayout/AbsoluteLayoutConnector.java @@ -68,6 +68,7 @@ public class AbsoluteLayoutConnector extends element); } + @Override public void updateCaption(ComponentConnector component) { VAbsoluteLayout absoluteLayoutWidget = getWidget(); AbsoluteWrapper componentWrapper = getWrapper(component); @@ -147,6 +148,7 @@ public class AbsoluteLayoutConnector extends } } + @Override public void layoutVertically() { VAbsoluteLayout layout = getWidget(); for (ComponentConnector paintable : getChildComponents()) { @@ -179,6 +181,7 @@ public class AbsoluteLayoutConnector extends } } + @Override public void layoutHorizontally() { VAbsoluteLayout layout = getWidget(); for (ComponentConnector paintable : getChildComponents()) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/accordion/AccordionConnector.java b/src/com/vaadin/terminal/gwt/client/ui/accordion/AccordionConnector.java index f022e97973..fd8bb9deed 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/accordion/AccordionConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/accordion/AccordionConnector.java @@ -57,10 +57,12 @@ public class AccordionConnector extends TabsheetBaseConnector implements return (VAccordion) super.getWidget(); } + @Override public void updateCaption(ComponentConnector component) { /* Accordion does not render its children's captions */ } + @Override public void layout() { VAccordion accordion = getWidget(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/accordion/VAccordion.java b/src/com/vaadin/terminal/gwt/client/ui/accordion/VAccordion.java index b83d5afb00..d9320787e8 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/accordion/VAccordion.java +++ b/src/com/vaadin/terminal/gwt/client/ui/accordion/VAccordion.java @@ -434,6 +434,7 @@ public class VAccordion extends VTabsheetBase { } } + @Override public void onClick(ClickEvent event) { onSelectTab(this); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/button/ButtonConnector.java b/src/com/vaadin/terminal/gwt/client/ui/button/ButtonConnector.java index d79aa96ac6..ae25a11028 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/button/ButtonConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/button/ButtonConnector.java @@ -103,18 +103,21 @@ public class ButtonConnector extends AbstractComponentConnector implements return (ButtonState) super.getState(); } + @Override public void onFocus(FocusEvent event) { // EventHelper.updateFocusHandler ensures that this is called only when // there is a listener on server side focusBlurProxy.focus(); } + @Override public void onBlur(BlurEvent event) { // EventHelper.updateFocusHandler ensures that this is called only when // there is a listener on server side focusBlurProxy.blur(); } + @Override public void onClick(ClickEvent event) { if (getState().isDisableOnClick()) { getWidget().setEnabled(false); diff --git a/src/com/vaadin/terminal/gwt/client/ui/button/ButtonState.java b/src/com/vaadin/terminal/gwt/client/ui/button/ButtonState.java index 2daceea0e8..9e44f62426 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/button/ButtonState.java +++ b/src/com/vaadin/terminal/gwt/client/ui/button/ButtonState.java @@ -102,6 +102,7 @@ public class ButtonState extends ComponentState implements TabIndexState { * * @see com.vaadin.terminal.gwt.client.ui.TabIndexState#getTabIndex() */ + @Override public int getTabIndex() { return tabIndex; } @@ -111,6 +112,7 @@ public class ButtonState extends ComponentState implements TabIndexState { * * @see com.vaadin.terminal.gwt.client.ui.TabIndexState#setTabIndex(int) */ + @Override public void setTabIndex(int tabIndex) { this.tabIndex = tabIndex; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java b/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java index bb3d8e2985..3232338f62 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/button/VButton.java @@ -281,6 +281,7 @@ public class VButton extends FocusWidget implements ClickHandler { * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event * .dom.client.ClickEvent) */ + @Override public void onClick(ClickEvent event) { if (BrowserInfo.get().isSafari()) { VButton.this.setFocus(true); diff --git a/src/com/vaadin/terminal/gwt/client/ui/checkbox/CheckBoxConnector.java b/src/com/vaadin/terminal/gwt/client/ui/checkbox/CheckBoxConnector.java index bc405b793b..e8ff3f697c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/checkbox/CheckBoxConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/checkbox/CheckBoxConnector.java @@ -114,18 +114,21 @@ public class CheckBoxConnector extends AbstractFieldConnector implements return (VCheckBox) super.getWidget(); } + @Override public void onFocus(FocusEvent event) { // EventHelper.updateFocusHandler ensures that this is called only when // there is a listener on server side focusBlurRpc.focus(); } + @Override public void onBlur(BlurEvent event) { // EventHelper.updateFocusHandler ensures that this is called only when // there is a listener on server side focusBlurRpc.blur(); } + @Override public void onClick(ClickEvent event) { if (!isEnabled()) { return; diff --git a/src/com/vaadin/terminal/gwt/client/ui/combobox/ComboBoxConnector.java b/src/com/vaadin/terminal/gwt/client/ui/combobox/ComboBoxConnector.java index ff153d30c9..9c0a5431f0 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/combobox/ComboBoxConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/combobox/ComboBoxConnector.java @@ -27,6 +27,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements * com.vaadin.terminal.gwt.client.Paintable#updateFromUIDL(com.vaadin.terminal * .gwt.client.UIDL, com.vaadin.terminal.gwt.client.ApplicationConnection) */ + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { // Save details getWidget().client = client; @@ -230,6 +231,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements return (VFilterSelect) super.getWidget(); } + @Override public void layout() { VFilterSelect widget = getWidget(); if (widget.initDone) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java b/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java index 9831001024..4dc7484459 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java @@ -101,6 +101,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * specified) and the caption of the item */ + @Override public String getDisplayString() { final StringBuffer sb = new StringBuffer(); if (iconUri != null) { @@ -124,6 +125,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * Get a string that represents this item. This is used in the text box. */ + @Override public String getReplacementString() { return caption; } @@ -150,6 +152,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * Executes a selection of this item. */ + @Override public void execute() { onSuggestionSelected(this); } @@ -454,6 +457,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * (int, int) */ + @Override public void setPosition(int offsetWidth, int offsetHeight) { int top = -1; @@ -591,6 +595,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, private VLazyExecutor delayedImageLoadExecutioner = new VLazyExecutor( 100, new ScheduledCommand() { + @Override public void execute() { if (suggestionPopup.isVisible() && suggestionPopup.isAttached()) { @@ -748,6 +753,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, private static final String SUBPART_PREFIX = "item"; + @Override public Element getSubPartElement(String subPart) { int index = Integer.parseInt(subPart.substring(SUBPART_PREFIX .length())); @@ -757,6 +763,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, return item.getElement(); } + @Override public String getSubPartName(Element subElement) { if (!getElement().isOrHasChild(subElement)) { return null; @@ -779,6 +786,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, return null; } + @Override public void onLoad(LoadEvent event) { // Handle icon onload events to ensure shadow is resized // correctly @@ -942,6 +950,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, selectedItemIcon.setStyleName("v-icon"); selectedItemIcon.addLoadHandler(new LoadHandler() { + @Override public void onLoad(LoadEvent event) { if (BrowserInfo.get().isIE8()) { // IE8 needs some help to discover it should reposition the @@ -1194,6 +1203,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * .event.dom.client.KeyDownEvent) */ + @Override public void onKeyDown(KeyDownEvent event) { if (enabled && !readonly) { int keyCode = event.getNativeKeyCode(); @@ -1356,6 +1366,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * The KeyUpEvent of the key depressed */ + @Override public void onKeyUp(KeyUpEvent event) { if (enabled && !readonly) { switch (event.getNativeKeyCode()) { @@ -1404,6 +1415,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * Listener for popupopener */ + @Override public void onClick(ClickEvent event) { if (textInputEnabled && event.getNativeEvent().getEventTarget().cast() == tb @@ -1468,6 +1480,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * .dom.client.FocusEvent) */ + @Override public void onFocus(FocusEvent event) { /* @@ -1505,6 +1518,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * .dom.client.BlurEvent) */ + @Override public void onBlur(BlurEvent event) { if (BrowserInfo.get().isIE() && preventNextBlurEventInIE) { @@ -1562,6 +1576,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * @see com.vaadin.terminal.gwt.client.Focusable#focus() */ + @Override public void focus() { focused = true; if (prompting && !readonly) { @@ -1670,6 +1685,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, suggestionPopup.hide(); } + @Override public Element getSubPartElement(String subPart) { if ("textbox".equals(subPart)) { return this.tb.getElement(); @@ -1679,6 +1695,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, return null; } + @Override public String getSubPartName(Element subElement) { if (tb.getElement().isOrHasChild(subElement)) { return "textbox"; diff --git a/src/com/vaadin/terminal/gwt/client/ui/csslayout/CssLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/csslayout/CssLayoutConnector.java index 4d341bddfc..96e703538d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/csslayout/CssLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/csslayout/CssLayoutConnector.java @@ -137,6 +137,7 @@ public class CssLayoutConnector extends AbstractLayoutConnector { return (VCssLayout) super.getWidget(); } + @Override public void updateCaption(ComponentConnector child) { Widget childWidget = child.getWidget(); FlowPane cssLayoutWidgetContainer = getWidget().panel; diff --git a/src/com/vaadin/terminal/gwt/client/ui/customcomponent/CustomComponentConnector.java b/src/com/vaadin/terminal/gwt/client/ui/customcomponent/CustomComponentConnector.java index 5001711d6c..2b2bca83c4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/customcomponent/CustomComponentConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/customcomponent/CustomComponentConnector.java @@ -19,6 +19,7 @@ public class CustomComponentConnector extends return (VCustomComponent) super.getWidget(); } + @Override public void updateCaption(ComponentConnector component) { // NOP, custom component dont render composition roots caption } diff --git a/src/com/vaadin/terminal/gwt/client/ui/customlayout/CustomLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/customlayout/CustomLayoutConnector.java index f8861caf92..2cebeb5c1a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/customlayout/CustomLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/customlayout/CustomLayoutConnector.java @@ -102,10 +102,12 @@ public class CustomLayoutConnector extends AbstractLayoutConnector implements return (VCustomLayout) super.getWidget(); } + @Override public void updateCaption(ComponentConnector paintable) { getWidget().updateCaption(paintable); } + @Override public void layout() { getWidget().iLayoutJS(DOM.getFirstChild(getWidget().getElement())); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java index f9d02d403b..159b5bc414 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/AbstractDateFieldConnector.java @@ -15,6 +15,7 @@ import com.vaadin.terminal.gwt.client.ui.AbstractFieldConnector; public class AbstractDateFieldConnector extends AbstractFieldConnector implements Paintable { + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/InlineDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/InlineDateFieldConnector.java index 7cd9c110ba..e7d1d48d5f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/InlineDateFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/InlineDateFieldConnector.java @@ -40,6 +40,7 @@ public class InlineDateFieldConnector extends AbstractDateFieldConnector { if (getWidget().currentResolution > VDateField.RESOLUTION_DAY) { getWidget().calendarPanel .setTimeChangeListener(new TimeChangeListener() { + @Override public void changed(int hour, int min, int sec, int msec) { Date d = getWidget().getDate(); if (d == null) { @@ -64,6 +65,7 @@ public class InlineDateFieldConnector extends AbstractDateFieldConnector { if (getWidget().currentResolution <= VDateField.RESOLUTION_MONTH) { getWidget().calendarPanel .setFocusChangeListener(new FocusChangeListener() { + @Override public void focusChanged(Date date) { Date date2 = new Date(); if (getWidget().calendarPanel.getDate() != null) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java index dfe0b327ac..85753095ca 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/PopupDateFieldConnector.java @@ -53,6 +53,7 @@ public class PopupDateFieldConnector extends TextualDateConnector { if (getWidget().currentResolution <= VPopupCalendar.RESOLUTION_MONTH) { getWidget().calendar .setFocusChangeListener(new FocusChangeListener() { + @Override public void focusChanged(Date date) { getWidget().updateValue(date); getWidget().buildDate(); @@ -68,6 +69,7 @@ public class PopupDateFieldConnector extends TextualDateConnector { if (getWidget().currentResolution > VPopupCalendar.RESOLUTION_DAY) { getWidget().calendar .setTimeChangeListener(new TimeChangeListener() { + @Override public void changed(int hour, int min, int sec, int msec) { Date d = getWidget().getDate(); if (d == null) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/VCalendarPanel.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/VCalendarPanel.java index acfff60d53..e4e25a5a2e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/VCalendarPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/VCalendarPanel.java @@ -121,6 +121,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt * .event.dom.client.ClickEvent) */ + @Override public void onClick(ClickEvent event) { Day day = (Day) event.getSource(); focusDay(day.getDate()); @@ -718,6 +719,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) */ + @Override public void onKeyDown(KeyDownEvent event) { handleKeyPress(event); } @@ -729,6 +731,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google * .gwt.event.dom.client.KeyPressEvent) */ + @Override public void onKeyPress(KeyPressEvent event) { handleKeyPress(event); } @@ -1124,6 +1127,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.MouseOutHandler#onMouseOut(com.google * .gwt.event.dom.client.MouseOutEvent) */ + @Override public void onMouseOut(MouseOutEvent event) { if (mouseTimer != null) { mouseTimer.cancel(); @@ -1137,6 +1141,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.MouseDownHandler#onMouseDown(com.google * .gwt.event.dom.client.MouseDownEvent) */ + @Override public void onMouseDown(MouseDownEvent event) { // Allow user to click-n-hold for fast-forward or fast-rewind. // Timer is first used for a 500ms delay after mousedown. After that has @@ -1169,6 +1174,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.MouseUpHandler#onMouseUp(com.google.gwt * .event.dom.client.MouseUpEvent) */ + @Override public void onMouseUp(MouseUpEvent event) { if (mouseTimer != null) { mouseTimer.cancel(); @@ -1354,6 +1360,7 @@ public class VCalendarPanel extends FocusableFlexTable implements ListBox lastDropDown = getLastDropDown(); lastDropDown.addKeyDownHandler(new KeyDownHandler() { + @Override public void onKeyDown(KeyDownEvent event) { boolean shiftKey = event.getNativeEvent().getShiftKey(); if (shiftKey) { @@ -1439,6 +1446,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.ChangeHandler#onChange(com.google.gwt * .event.dom.client.ChangeEvent) */ + @Override public void onChange(ChangeEvent event) { /* * Value from dropdowns gets always set for the value. Like year and @@ -1589,6 +1597,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event * .dom.client.BlurEvent) */ + @Override public void onBlur(final BlurEvent event) { if (event.getSource() instanceof VCalendarPanel) { hasFocus = false; @@ -1603,6 +1612,7 @@ public class VCalendarPanel extends FocusableFlexTable implements * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) */ + @Override public void onFocus(FocusEvent event) { if (event.getSource() instanceof VCalendarPanel) { hasFocus = true; @@ -1627,6 +1637,7 @@ public class VCalendarPanel extends FocusableFlexTable implements private static final String SUBPART_DAY = "day"; private static final String SUBPART_MONTH_YEAR_HEADER = "header"; + @Override public String getSubPartName(Element subElement) { if (contains(nextMonth, subElement)) { return SUBPART_NEXT_MONTH; @@ -1685,6 +1696,7 @@ public class VCalendarPanel extends FocusableFlexTable implements return w.getElement().isOrHasChild(subElement); } + @Override public Element getSubPartElement(String subPart) { if (SUBPART_NEXT_MONTH.equals(subPart)) { return nextMonth.getElement(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateFieldCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateFieldCalendar.java index 84b3c678eb..e411fb3013 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateFieldCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/VDateFieldCalendar.java @@ -23,16 +23,19 @@ public class VDateFieldCalendar extends VDateField { calendarPanel = new VCalendarPanel(); add(calendarPanel); calendarPanel.setSubmitListener(new SubmitListener() { + @Override public void onSubmit() { updateValueFromPanel(); } + @Override public void onCancel() { // TODO Auto-generated method stub } }); calendarPanel.setFocusOutListener(new FocusOutListener() { + @Override public boolean onFocusOut(DomEvent event) { updateValueFromPanel(); return false; diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/VPopupCalendar.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/VPopupCalendar.java index 7011e5358b..de6ebf29af 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/VPopupCalendar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/VPopupCalendar.java @@ -66,6 +66,7 @@ public class VPopupCalendar extends VTextualDate implements Field, calendar = GWT.create(VCalendarPanel.class); calendar.setFocusOutListener(new FocusOutListener() { + @Override public boolean onFocusOut(DomEvent event) { event.preventDefault(); closeCalendarPanel(); @@ -74,6 +75,7 @@ public class VPopupCalendar extends VTextualDate implements Field, }); calendar.setSubmitListener(new SubmitListener() { + @Override public void onSubmit() { // Update internal value and send valuechange event if immediate updateValue(calendar.getDate()); @@ -84,6 +86,7 @@ public class VPopupCalendar extends VTextualDate implements Field, closeCalendarPanel(); } + @Override public void onCancel() { closeCalendarPanel(); } @@ -164,6 +167,7 @@ public class VPopupCalendar extends VTextualDate implements Field, popup.setWidth(""); popup.setHeight(""); popup.setPopupPositionAndShow(new PositionCallback() { + @Override public void setPosition(int offsetWidth, int offsetHeight) { final int w = offsetWidth; final int h = offsetHeight; @@ -232,6 +236,7 @@ public class VPopupCalendar extends VTextualDate implements Field, * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event * .dom.client.ClickEvent) */ + @Override public void onClick(ClickEvent event) { if (event.getSource() == calendarToggle && isEnabled()) { openCalendarPanel(); @@ -245,6 +250,7 @@ public class VPopupCalendar extends VTextualDate implements Field, * com.google.gwt.event.logical.shared.CloseHandler#onClose(com.google.gwt * .event.logical.shared.CloseEvent) */ + @Override public void onClose(CloseEvent event) { if (event.getSource() == popup) { buildDate(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/datefield/VTextualDate.java b/src/com/vaadin/terminal/gwt/client/ui/datefield/VTextualDate.java index db4eca152a..5febb05440 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/datefield/VTextualDate.java +++ b/src/com/vaadin/terminal/gwt/client/ui/datefield/VTextualDate.java @@ -50,6 +50,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, text.addStyleName(CLASSNAME + "-textfield"); text.addChangeHandler(this); text.addFocusHandler(new FocusHandler() { + @Override public void onFocus(FocusEvent event) { text.addStyleName(VTextField.CLASSNAME + "-" + VTextField.CLASSNAME_FOCUS); @@ -66,6 +67,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, } }); text.addBlurHandler(new BlurHandler() { + @Override public void onBlur(BlurEvent event) { text.removeStyleName(VTextField.CLASSNAME + "-" + VTextField.CLASSNAME_FOCUS); @@ -168,6 +170,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, } } + @Override @SuppressWarnings("deprecation") public void onChange(ChangeEvent event) { if (!text.getText().equals("")) { @@ -291,6 +294,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, return format.trim(); } + @Override public void focus() { text.setFocus(true); } @@ -315,6 +319,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, private final String TEXTFIELD_ID = "field"; + @Override public Element getSubPartElement(String subPart) { if (subPart.equals(TEXTFIELD_ID)) { return text.getElement(); @@ -323,6 +328,7 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, return null; } + @Override public String getSubPartName(Element subElement) { if (text.getElement().isOrHasChild(subElement)) { return TEXTFIELD_ID; diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java index ce47c7d13a..ce0533ac1f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAbstractDropHandler.java @@ -47,6 +47,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { /** * Default implementation does nothing. */ + @Override public void dragOver(VDragEvent drag) { } @@ -55,6 +56,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { * Default implementation does nothing. Implementors should clean possible * emphasis or drag icons here. */ + @Override public void dragLeave(VDragEvent drag) { } @@ -73,8 +75,10 @@ public abstract class VAbstractDropHandler implements VDropHandler { * implementation. * */ + @Override public void dragEnter(final VDragEvent drag) { validate(new VAcceptCallback() { + @Override public void accepted(VDragEvent event) { dragAccepted(drag); } @@ -94,6 +98,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { protected void validate(final VAcceptCallback cb, final VDragEvent event) { Command checkCriteria = new Command() { + @Override public void execute() { acceptCriteria.accept(event, criterioUIDL, cb); } @@ -109,12 +114,14 @@ public abstract class VAbstractDropHandler implements VDropHandler { * can't be verified on client or if {@link AcceptCriterion} are met on * client. */ + @Override public boolean drop(VDragEvent drag) { if (acceptCriteria.needsServerSideCheck(drag, criterioUIDL)) { return true; } else { validated = false; acceptCriteria.accept(drag, criterioUIDL, new VAcceptCallback() { + @Override public void accepted(VDragEvent event) { validated = true; } @@ -129,6 +136,7 @@ public abstract class VAbstractDropHandler implements VDropHandler { * side counterpart of the Paintable is expected to implement * {@link DropTarget} interface. */ + @Override public abstract ComponentConnector getConnector(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java index 0d71e23903..b1a88166ec 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAcceptCriterion.java @@ -19,6 +19,7 @@ public abstract class VAcceptCriterion { final VAcceptCallback callback) { if (needsServerSideCheck(drag, configuration)) { VDragEventServerCallback acceptCallback = new VDragEventServerCallback() { + @Override public void handleResponse(boolean accepted, UIDL response) { if (accepted) { callback.accepted(drag); diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VAnd.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VAnd.java index 19399d7d4a..9d11ccc500 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VAnd.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VAnd.java @@ -33,6 +33,7 @@ final public class VAnd extends VAcceptCriterion implements VAcceptCallback { return true; } + @Override public void accepted(VDragEvent event) { b1 = true; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java index 2f404a3028..45b3cdaf4b 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VDragAndDropManager.java @@ -48,6 +48,7 @@ public class VDragAndDropManager { private final class DefaultDragAndDropEventHandler implements NativePreviewHandler { + @Override public void onPreviewNativeEvent(NativePreviewEvent event) { NativeEvent nativeEvent = event.getNativeEvent(); @@ -307,6 +308,7 @@ public class VDragAndDropManager { final Command startDrag = new Command() { + @Override public void execute() { isStarted = true; addActiveDragSourceStyleName(); @@ -352,6 +354,7 @@ public class VDragAndDropManager { deferredStartRegistration = Event .addNativePreviewHandler(new NativePreviewHandler() { + @Override public void onPreviewNativeEvent( NativePreviewEvent event) { int typeInt = event.getTypeInt(); @@ -509,6 +512,7 @@ public class VDragAndDropManager { final ApplicationConnection client = currentDropHandler .getApplicationConnection(); Scheduler.get().scheduleFixedDelay(new RepeatingCommand() { + @Override public boolean execute() { if (!client.hasActiveRequest()) { removeActiveDragSourceStyleName(dragSource); diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VLazyInitItemIdentifiers.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VLazyInitItemIdentifiers.java index e3bed02642..a1dbccdfc7 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VLazyInitItemIdentifiers.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VLazyInitItemIdentifiers.java @@ -48,6 +48,7 @@ public class VLazyInitItemIdentifiers extends VAcceptCriterion { VDragEventServerCallback acceptCallback = new VDragEventServerCallback() { + @Override public void handleResponse(boolean accepted, UIDL response) { hashSet = new HashSet(); String[] stringArrayAttribute = response diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java index e4d2dff606..52b9358791 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VNot.java @@ -33,6 +33,7 @@ final public class VNot extends VAcceptCriterion { b1 = false; VAcceptCallback accept1cb = new VAcceptCallback() { + @Override public void accepted(VDragEvent event) { b1 = true; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VOr.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VOr.java index 91ba4bf0c4..c5c8dbb052 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VOr.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VOr.java @@ -41,6 +41,7 @@ final public class VOr extends VAcceptCriterion implements VAcceptCallback { return false; // not used here } + @Override public void accepted(VDragEvent event) { accepted = true; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/dd/VServerAccept.java b/src/com/vaadin/terminal/gwt/client/ui/dd/VServerAccept.java index 64c2da5320..865df821d9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/dd/VServerAccept.java +++ b/src/com/vaadin/terminal/gwt/client/ui/dd/VServerAccept.java @@ -16,6 +16,7 @@ final public class VServerAccept extends VAcceptCriterion { final VAcceptCallback callback) { VDragEventServerCallback acceptCallback = new VDragEventServerCallback() { + @Override public void handleResponse(boolean accepted, UIDL response) { if (accepted) { callback.accepted(drag); diff --git a/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java b/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java index 2a78cc4433..9d99eadeba 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java @@ -17,6 +17,7 @@ import com.vaadin.ui.DragAndDropWrapper; public class DragAndDropWrapperConnector extends CustomComponentConnector implements Paintable { + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { getWidget().client = client; if (isRealUpdate(uidl) && !uidl.hasAttribute("hidden")) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java b/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java index b1fffc8355..145e5b0768 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java +++ b/src/com/vaadin/terminal/gwt/client/ui/draganddropwrapper/VDragAndDropWrapper.java @@ -68,6 +68,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements setStyleName(CLASSNAME); addDomHandler(new MouseDownHandler() { + @Override public void onMouseDown(MouseDownEvent event) { if (startDrag(event.getNativeEvent())) { event.preventDefault(); // prevent text selection @@ -77,6 +78,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements addDomHandler(new TouchStartHandler() { + @Override public void onTouchStart(TouchStartEvent event) { if (startDrag(event.getNativeEvent())) { /* @@ -166,6 +168,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements private ReadyStateChangeHandler readyStateChangeHandler = new ReadyStateChangeHandler() { + @Override public void onReadyStateChange(XMLHttpRequest xhr) { if (xhr.getReadyState() == XMLHttpRequest.DONE) { // visit server for possible @@ -182,6 +185,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements void startNextUpload() { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { if (!uploading) { if (fileIds.size() > 0) { @@ -413,6 +417,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements files.add(file); } + @Override public VDropHandler getDropHandler() { return dropHandler; } @@ -451,6 +456,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements currentlyValid = false; validate(new VAcceptCallback() { + @Override public void accepted(VDragEvent event) { dragAccepted(drag); } @@ -495,6 +501,7 @@ public class VDragAndDropWrapper extends VCustomComponent implements VDragAndDropWrapper.this); } + @Override public ApplicationConnection getApplicationConnection() { return client; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java b/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java index fe3549e7f2..dbbf91e091 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/embedded/EmbeddedConnector.java @@ -41,6 +41,7 @@ public class EmbeddedConnector extends AbstractComponentConnector implements rpc = RpcProxy.create(EmbeddedServerRpc.class, this); } + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; diff --git a/src/com/vaadin/terminal/gwt/client/ui/form/FormConnector.java b/src/com/vaadin/terminal/gwt/client/ui/form/FormConnector.java index 981c753dd1..54f82eb9b9 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/form/FormConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/form/FormConnector.java @@ -25,6 +25,7 @@ public class FormConnector extends AbstractComponentContainerConnector implements Paintable, MayScrollChildren { private final ElementResizeListener footerResizeListener = new ElementResizeListener() { + @Override public void onElementResize(ElementResizeEvent e) { VForm form = getWidget(); @@ -57,6 +58,7 @@ public class FormConnector extends AbstractComponentContainerConnector return false; } + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { getWidget().client = client; getWidget().id = uidl.getId(); @@ -180,6 +182,7 @@ public class FormConnector extends AbstractComponentContainerConnector } } + @Override public void updateCaption(ComponentConnector component) { // NOP form don't render caption for neither field layout nor footer // layout diff --git a/src/com/vaadin/terminal/gwt/client/ui/form/VForm.java b/src/com/vaadin/terminal/gwt/client/ui/form/VForm.java index 81f24a8e7e..823b0e83ae 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/form/VForm.java +++ b/src/com/vaadin/terminal/gwt/client/ui/form/VForm.java @@ -62,6 +62,7 @@ public class VForm extends ComplexPanel implements KeyDownHandler { fieldSet.appendChild(footerContainer); } + @Override public void onKeyDown(KeyDownEvent event) { shortcutHandler.handleKeyboardEvent(Event.as(event.getNativeEvent())); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java index c08651ded1..ebe83654fe 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/formlayout/FormLayoutConnector.java @@ -79,6 +79,7 @@ public class FormLayoutConnector extends AbstractLayoutConnector { } + @Override public void updateCaption(ComponentConnector component) { getWidget().table.updateCaption(component.getWidget(), component.getState(), component.isEnabled()); diff --git a/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java b/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java index 1a161c529d..757315f72e 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java +++ b/src/com/vaadin/terminal/gwt/client/ui/formlayout/VFormLayout.java @@ -87,6 +87,7 @@ public class VFormLayout extends SimplePanel { * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt * .event.dom.client.ClickEvent) */ + @Override public void onClick(ClickEvent event) { Caption caption = (Caption) event.getSource(); if (caption.getOwner() != null) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java index f28b0237f7..5d53c688b1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/gridlayout/GridLayoutConnector.java @@ -83,6 +83,7 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector } + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { VGridLayout layout = getWidget(); layout.client = client; @@ -186,6 +187,7 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector } + @Override public void updateCaption(ComponentConnector childConnector) { if (!childConnector.delegateCaptionHandling()) { // Check not required by interface but by workarounds in this class @@ -224,10 +226,12 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector return (VGridLayout) super.getWidget(); } + @Override public void layoutVertically() { getWidget().updateHeight(); } + @Override public void layoutHorizontally() { getWidget().updateWidth(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/link/LinkConnector.java b/src/com/vaadin/terminal/gwt/client/ui/link/LinkConnector.java index c002d2dd50..070e74d6bf 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/link/LinkConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/link/LinkConnector.java @@ -22,6 +22,7 @@ public class LinkConnector extends AbstractComponentConnector implements return false; } + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java b/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java index bef7943e3f..4df3220ef1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java +++ b/src/com/vaadin/terminal/gwt/client/ui/link/VLink.java @@ -53,6 +53,7 @@ public class VLink extends HTML implements ClickHandler { setStyleName(CLASSNAME); } + @Override public void onClick(ClickEvent event) { if (enabled) { if (target == null) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java b/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java index 1b1c2c44e3..6f3f876fb7 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/listselect/VListSelect.java @@ -105,6 +105,7 @@ public class VListSelect extends VOptionGroupBase { getOptionsContainer().setTabIndex(tabIndex); } + @Override public void focus() { select.setFocus(true); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBar.java index 7bee870387..5cb3fb83b4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBar.java @@ -246,6 +246,7 @@ public class MenuBar extends Widget implements PopupListener { } } + @Override public void onPopupClosed(PopupPanel sender, boolean autoClosed) { // If the menu popup was auto-closed, close all of its parents as well. if (autoClosed) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java index a18e4d734a..7966185c00 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuBarConnector.java @@ -31,6 +31,7 @@ public class MenuBarConnector extends AbstractComponentConnector implements * This method is called when the page is loaded for the first time, and * every time UI changes in the component are received from the server. */ + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; @@ -107,6 +108,7 @@ public class MenuBarConnector extends AbstractComponentConnector implements // Construct a command that fires onMenuClick(int) with the // item's id-number cmd = new Command() { + @Override public void execute() { getWidget().hostReference.onMenuClick(itemId); } @@ -160,6 +162,7 @@ public class MenuBarConnector extends AbstractComponentConnector implements return (VMenuBar) super.getWidget(); } + @Override public void layout() { getWidget().iLayout(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuItem.java b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuItem.java index af79ba7c5e..7f150d9a5f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuItem.java +++ b/src/com/vaadin/terminal/gwt/client/ui/menubar/MenuItem.java @@ -121,6 +121,7 @@ public class MenuItem extends UIObject implements HasHTML { return command; } + @Override public String getHTML() { return DOM.getInnerHTML(getElement()); } @@ -143,6 +144,7 @@ public class MenuItem extends UIObject implements HasHTML { return subMenu; } + @Override public String getText() { return DOM.getInnerText(getElement()); } @@ -157,6 +159,7 @@ public class MenuItem extends UIObject implements HasHTML { command = cmd; } + @Override public void setHTML(String html) { DOM.setInnerHTML(getElement(), html); } @@ -171,6 +174,7 @@ public class MenuItem extends UIObject implements HasHTML { this.subMenu = subMenu; } + @Override public void setText(String text) { DOM.setInnerText(getElement(), text); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java b/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java index 6133b7d80c..a96be0bc2f 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/menubar/VMenuBar.java @@ -91,6 +91,7 @@ public class VMenuBar extends SimpleFocusablePanel implements private VLazyExecutor iconLoadedExecutioner = new VLazyExecutor(100, new ScheduledCommand() { + @Override public void execute() { iLayout(true); } @@ -635,6 +636,7 @@ public class VMenuBar extends SimpleFocusablePanel implements /** * Listener method, fired when this menu is closed */ + @Override public void onClose(CloseEvent event) { hideChildren(); if (event.isAutoClosed()) { @@ -849,10 +851,12 @@ public class VMenuBar extends SimpleFocusablePanel implements return command; } + @Override public String getHTML() { return html; } + @Override public void setHTML(String html) { this.html = html; DOM.setInnerHTML(getElement(), html); @@ -862,10 +866,12 @@ public class VMenuBar extends SimpleFocusablePanel implements Util.sinkOnloadForImages(getElement()); } + @Override public String getText() { return html; } + @Override public void setText(String text) { setHTML(Util.escapeHTML(text)); } @@ -1048,6 +1054,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google * .gwt.event.dom.client.KeyPressEvent) */ + @Override public void onKeyPress(KeyPressEvent event) { if (handleNavigation(event.getNativeEvent().getKeyCode(), event.isControlKeyDown() || event.isMetaKeyDown(), @@ -1063,6 +1070,7 @@ public class VMenuBar extends SimpleFocusablePanel implements * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) */ + @Override public void onKeyDown(KeyDownEvent event) { if (handleNavigation(event.getNativeEvent().getKeyCode(), event.isControlKeyDown() || event.isMetaKeyDown(), @@ -1383,12 +1391,14 @@ public class VMenuBar extends SimpleFocusablePanel implements * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) */ + @Override public void onFocus(FocusEvent event) { } private final String SUBPART_PREFIX = "item"; + @Override public Element getSubPartElement(String subPart) { int index = Integer .parseInt(subPart.substring(SUBPART_PREFIX.length())); @@ -1397,6 +1407,7 @@ public class VMenuBar extends SimpleFocusablePanel implements return item.getElement(); } + @Override public String getSubPartName(Element subElement) { if (!getElement().isOrHasChild(subElement)) { return null; diff --git a/src/com/vaadin/terminal/gwt/client/ui/nativebutton/NativeButtonConnector.java b/src/com/vaadin/terminal/gwt/client/ui/nativebutton/NativeButtonConnector.java index c010fba711..1f2b188b3d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/nativebutton/NativeButtonConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/nativebutton/NativeButtonConnector.java @@ -107,12 +107,14 @@ public class NativeButtonConnector extends AbstractComponentConnector implements return (ButtonState) super.getState(); } + @Override public void onFocus(FocusEvent event) { // EventHelper.updateFocusHandler ensures that this is called only when // there is a listener on server side focusBlurRpc.focus(); } + @Override public void onBlur(BlurEvent event) { // EventHelper.updateFocusHandler ensures that this is called only when // there is a listener on server side diff --git a/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java b/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java index e5a2e1253c..d0ddae30a4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java +++ b/src/com/vaadin/terminal/gwt/client/ui/nativebutton/VNativeButton.java @@ -100,6 +100,7 @@ public class VNativeButton extends Button implements ClickHandler { * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event * .dom.client.ClickEvent) */ + @Override public void onClick(ClickEvent event) { if (paintableId == null || client == null) { return; diff --git a/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java b/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java index cab23b1bc2..ea5292724d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/nativeselect/VNativeSelect.java @@ -108,6 +108,7 @@ public class VNativeSelect extends VOptionGroupBase implements Field { getOptionsContainer().setTabIndex(tabIndex); } + @Override public void focus() { select.setFocus(true); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/optiongroup/OptionGroupBaseConnector.java b/src/com/vaadin/terminal/gwt/client/ui/optiongroup/OptionGroupBaseConnector.java index 3658126a97..a4dd72906d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/optiongroup/OptionGroupBaseConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/optiongroup/OptionGroupBaseConnector.java @@ -14,6 +14,7 @@ import com.vaadin.terminal.gwt.client.ui.textfield.VTextField; public abstract class OptionGroupBaseConnector extends AbstractFieldConnector implements Paintable { + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { // Save details diff --git a/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroup.java b/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroup.java index d6e6949242..49e75afe92 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroup.java +++ b/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroup.java @@ -51,6 +51,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, protected List blurHandlers = null; private final LoadHandler iconLoadHandler = new LoadHandler() { + @Override public void onLoad(LoadEvent event) { Util.notifyParentOfSizeChange(VOptionGroup.this, true); } @@ -154,6 +155,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, } } + @Override public void focus() { Iterator iterator = panel.iterator(); if (iterator.hasNext()) { @@ -161,6 +163,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, } } + @Override public void onFocus(FocusEvent arg0) { if (!blurOccured) { // no blur occured before this focus event @@ -178,10 +181,12 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, } } + @Override public void onBlur(BlurEvent arg0) { blurOccured = true; if (sendBlurEvents) { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { // check whether blurOccured still is true and then send the // event out to the server diff --git a/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroupBase.java b/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroupBase.java index a512f024b8..d128d7deb1 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroupBase.java +++ b/src/com/vaadin/terminal/gwt/client/ui/optiongroup/VOptionGroupBase.java @@ -126,6 +126,7 @@ public abstract class VOptionGroupBase extends Composite implements Field, abstract protected void setTabIndex(int tabIndex); + @Override public void onClick(ClickEvent event) { if (event.getSource() == newItemButton && !newItemField.getText().equals("")) { @@ -135,6 +136,7 @@ public abstract class VOptionGroupBase extends Composite implements Field, } } + @Override public void onChange(ChangeEvent event) { if (multiselect) { client.updateVariable(paintableId, "selected", getSelectedItems(), @@ -145,6 +147,7 @@ public abstract class VOptionGroupBase extends Composite implements Field, } } + @Override public void onKeyPress(KeyPressEvent event) { if (event.getSource() == newItemField && event.getCharCode() == KeyCodes.KEY_ENTER) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java index 7c748df29d..b7d243c241 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java @@ -73,6 +73,7 @@ public abstract class AbstractOrderedLayoutConnector extends return (AbstractOrderedLayoutState) super.getState(); } + @Override public void updateCaption(ComponentConnector component) { VMeasuringOrderedLayout layout = getWidget(); if (VCaption.isNeeded(component.getState())) { @@ -263,6 +264,7 @@ public abstract class AbstractOrderedLayoutConnector extends } } + @Override public void layoutHorizontally() { if (getWidget().isVertical) { layoutSecondaryDirection(); @@ -271,6 +273,7 @@ public abstract class AbstractOrderedLayoutConnector extends } } + @Override public void layoutVertically() { if (getWidget().isVertical) { layoutPrimaryDirection(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java index ea7ffda9db..c28432e917 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/panel/PanelConnector.java @@ -71,6 +71,7 @@ public class PanelConnector extends AbstractComponentContainerConnector return false; } + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (isRealUpdate(uidl)) { @@ -165,6 +166,7 @@ public class PanelConnector extends AbstractComponentContainerConnector getWidget().contentNode.setTabIndex(getState().getTabIndex()); } + @Override public void updateCaption(ComponentConnector component) { // NOP: layouts caption, errors etc not rendered in Panel } @@ -174,6 +176,7 @@ public class PanelConnector extends AbstractComponentContainerConnector return (VPanel) super.getWidget(); } + @Override public void layout() { updateSizes(); } @@ -200,6 +203,7 @@ public class PanelConnector extends AbstractComponentContainerConnector panel.scrollLeft = panel.contentNode.getScrollLeft(); } + @Override public void postLayout() { VPanel panel = getWidget(); if (uidlScrollTop != null) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java b/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java index d56a82c46b..8764d61c3a 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/panel/VPanel.java @@ -100,6 +100,7 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, * @see com.vaadin.terminal.gwt.client.Focusable#focus() */ + @Override public void focus() { setFocus(true); @@ -170,6 +171,7 @@ public class VPanel extends SimplePanel implements ShortcutActionHandlerOwner, } } + @Override public ShortcutActionHandler getShortcutActionHandler() { return shortcutHandler; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/popupview/PopupViewConnector.java b/src/com/vaadin/terminal/gwt/client/ui/popupview/PopupViewConnector.java index c5117fdddb..96ffd04391 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/popupview/PopupViewConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/popupview/PopupViewConnector.java @@ -31,6 +31,7 @@ public class PopupViewConnector extends AbstractComponentContainerConnector * @see com.vaadin.terminal.gwt.client.ComponentConnector#updateFromUIDL(com.vaadin.terminal.gwt.client.UIDL, * com.vaadin.terminal.gwt.client.ApplicationConnection) */ + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; @@ -81,6 +82,7 @@ public class PopupViewConnector extends AbstractComponentContainerConnector } }// updateFromUIDL + @Override public void updateCaption(ComponentConnector component) { if (VCaption.isNeeded(component.getState())) { if (getWidget().popup.captionWrapper != null) { @@ -104,6 +106,7 @@ public class PopupViewConnector extends AbstractComponentContainerConnector return (VPopupView) super.getWidget(); } + @Override public void postLayout() { if (centerAfterLayout) { centerAfterLayout = false; diff --git a/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java b/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java index c8a0222ee2..c923c5d0ab 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java +++ b/src/com/vaadin/terminal/gwt/client/ui/popupview/VPopupView.java @@ -59,6 +59,7 @@ public class VPopupView extends HTML { // When we click to open the popup... addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { updateState(true); } @@ -66,6 +67,7 @@ public class VPopupView extends HTML { // ..and when we close it popup.addCloseHandler(new CloseHandler() { + @Override public void onClose(CloseEvent event) { updateState(false); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/progressindicator/ProgressIndicatorConnector.java b/src/com/vaadin/terminal/gwt/client/ui/progressindicator/ProgressIndicatorConnector.java index 9d0532fae3..c37e9beee3 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/progressindicator/ProgressIndicatorConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/progressindicator/ProgressIndicatorConnector.java @@ -16,6 +16,7 @@ import com.vaadin.ui.ProgressIndicator; public class ProgressIndicatorConnector extends AbstractFieldConnector implements Paintable { + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java index db52640088..7647221656 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/RichTextAreaConnector.java @@ -17,6 +17,7 @@ import com.vaadin.ui.RichTextArea; public class RichTextAreaConnector extends AbstractFieldConnector implements Paintable, BeforeShortcutActionListener { + @Override public void updateFromUIDL(final UIDL uidl, ApplicationConnection client) { getWidget().client = client; getWidget().id = uidl.getId(); @@ -59,6 +60,7 @@ public class RichTextAreaConnector extends AbstractFieldConnector implements } + @Override public void onBeforeShortcutAction(Event e) { getWidget().synchronizeContentToServer(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java index eb062a3799..5d5f7d7b8c 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java +++ b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextArea.java @@ -160,6 +160,7 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler, } // TODO is this really used, or does everything go via onBlur() only? + @Override public void onChange(ChangeEvent event) { synchronizeContentToServer(); } @@ -177,6 +178,7 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler, } } + @Override public void onBlur(BlurEvent event) { synchronizeContentToServer(); // TODO notify possible server side blur/focus listeners @@ -242,6 +244,7 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler, * delay the height setting so the DOM has had time to stabilize. */ Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { int editorHeight = getOffsetHeight() - getExtraVerticalPixels() @@ -281,9 +284,11 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler, } } + @Override public void onKeyPress(KeyPressEvent event) { if (maxLength >= 0) { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { if (rta.getHTML().length() > maxLength) { rta.setHTML(rta.getHTML().substring(0, maxLength)); @@ -293,6 +298,7 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler, } } + @Override public void onKeyDown(KeyDownEvent event) { // delegate to closest shortcut action handler // throw event from the iframe forward to the shortcuthandler @@ -320,14 +326,17 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler, return hasShortcutActionHandler; } + @Override public int getTabIndex() { return rta.getTabIndex(); } + @Override public void setAccessKey(char key) { rta.setAccessKey(key); } + @Override public void setFocus(boolean focused) { /* * Similar issue as with selectAll. Focusing must happen before possible @@ -342,6 +351,7 @@ public class VRichTextArea extends Composite implements Field, ChangeHandler, }.schedule(300); } + @Override public void setTabIndex(int index) { rta.setTabIndex(index); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextToolbar.java b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextToolbar.java index 1e1805efdf..d86c7a4bf5 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextToolbar.java +++ b/src/com/vaadin/terminal/gwt/client/ui/richtextarea/VRichTextToolbar.java @@ -172,6 +172,7 @@ public class VRichTextToolbar extends Composite { private class EventHandler implements ClickHandler, ChangeHandler, KeyUpHandler { + @Override @SuppressWarnings("deprecation") public void onChange(ChangeEvent event) { Object sender = event.getSource(); @@ -193,6 +194,7 @@ public class VRichTextToolbar extends Composite { } } + @Override @SuppressWarnings("deprecation") public void onClick(ClickEvent event) { Object sender = event.getSource(); @@ -249,6 +251,7 @@ public class VRichTextToolbar extends Composite { } } + @Override public void onKeyUp(KeyUpEvent event) { if (event.getSource() == richText) { // We use the RichTextArea's onKeyUp event to update the toolbar diff --git a/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java b/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java index 142a0fd89c..fddb76e755 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java +++ b/src/com/vaadin/terminal/gwt/client/ui/root/VRoot.java @@ -123,6 +123,7 @@ public class VRoot extends SimplePanel implements ResizeHandler, */ private final ValueChangeHandler historyChangeHandler = new ValueChangeHandler() { + @Override public void onValueChange(ValueChangeEvent event) { String newFragment = event.getValue(); @@ -138,6 +139,7 @@ public class VRoot extends SimplePanel implements ResizeHandler, private VLazyExecutor delayedResizeExecutor = new VLazyExecutor(200, new ScheduledCommand() { + @Override public void execute() { performSizeCheck(); } @@ -361,6 +363,7 @@ public class VRoot extends SimplePanel implements ResizeHandler, * .gwt.event.logical.shared.ResizeEvent) */ + @Override public void onResize(ResizeEvent event) { triggerSizeChangeCheck(); } @@ -416,6 +419,7 @@ public class VRoot extends SimplePanel implements ResizeHandler, $wnd.location = url; }-*/; + @Override public void onWindowClosing(Window.ClosingEvent event) { // Change focus on this window in order to ensure that all state is // collected from textfields @@ -435,10 +439,12 @@ public class VRoot extends SimplePanel implements ResizeHandler, } }-*/; + @Override public ShortcutActionHandler getShortcutActionHandler() { return actionHandler; } + @Override public void focus() { getElement().focus(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java b/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java index 6fd7f8b6aa..978ea162ab 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/slider/SliderConnector.java @@ -16,6 +16,7 @@ import com.vaadin.ui.Slider; public class SliderConnector extends AbstractFieldConnector implements Paintable { + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { getWidget().client = client; @@ -51,6 +52,7 @@ public class SliderConnector extends AbstractFieldConnector implements if (!getWidget().vertical) { // Draw handle with a delay to allow base to gain maximum width Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { getWidget().buildHandle(); getWidget().setValue(getWidget().value, false); diff --git a/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java b/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java index e5282dc45e..06608c95fe 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java +++ b/src/com/vaadin/terminal/gwt/client/ui/slider/VSlider.java @@ -78,6 +78,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, private VLazyExecutor delayedValueUpdater = new VLazyExecutor(100, new ScheduledCommand() { + @Override public void execute() { updateValueToServer(); acceleration = 1; @@ -159,6 +160,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, DOM.setStyleAttribute(base, styleAttribute, MIN_SIZE + "px"); Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { final Element p = DOM.getParent(getElement()); if (DOM.getElementPropertyInt(p, domProperty) > (MIN_SIZE + 5)) { @@ -416,6 +418,7 @@ public class VSlider extends SimpleFocusablePanel implements Field, } } + @Override public void iLayout() { if (vertical) { setHeight(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java b/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java index e33755bc9b..8a210ecced 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/splitpanel/AbstractSplitPanelConnector.java @@ -41,6 +41,7 @@ public abstract class AbstractSplitPanelConnector extends getWidget().addHandler(new SplitterMoveHandler() { + @Override public void splitterMoved(SplitterMoveEvent event) { String position = getWidget().getSplitterPosition(); float pos = 0; @@ -61,6 +62,7 @@ public abstract class AbstractSplitPanelConnector extends }, SplitterMoveEvent.TYPE); } + @Override public void updateCaption(ComponentConnector component) { // TODO Implement caption handling } @@ -145,6 +147,7 @@ public abstract class AbstractSplitPanelConnector extends getWidget().makeScrollable(); } + @Override public void layout() { VAbstractSplitPanel splitPanel = getWidget(); splitPanel.setSplitPosition(splitPanel.position); diff --git a/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java b/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java index e2f30c6676..1c14ce2a73 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java @@ -125,12 +125,14 @@ public class VAbstractSplitPanel extends ComplexPanel { makeScrollable(); addDomHandler(new TouchCancelHandler() { + @Override public void onTouchCancel(TouchCancelEvent event) { // TODO When does this actually happen?? VConsole.log("TOUCH CANCEL"); } }, TouchCancelEvent.getType()); addDomHandler(new TouchStartHandler() { + @Override public void onTouchStart(TouchStartEvent event) { Node target = event.getTouches().get(0).getTarget().cast(); if (splitter.isOrHasChild(target)) { @@ -139,6 +141,7 @@ public class VAbstractSplitPanel extends ComplexPanel { } }, TouchStartEvent.getType()); addDomHandler(new TouchMoveHandler() { + @Override public void onTouchMove(TouchMoveEvent event) { if (resizing) { onMouseMove(Event.as(event.getNativeEvent())); @@ -146,6 +149,7 @@ public class VAbstractSplitPanel extends ComplexPanel { } }, TouchMoveEvent.getType()); addDomHandler(new TouchEndHandler() { + @Override public void onTouchEnd(TouchEndEvent event) { if (resizing) { onMouseUp(Event.as(event.getNativeEvent())); diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java b/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java index ab867ea045..7ca449c0b7 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/table/TableConnector.java @@ -44,6 +44,7 @@ public class TableConnector extends AbstractComponentContainerConnector * com.vaadin.terminal.gwt.client.Paintable#updateFromUIDL(com.vaadin.terminal * .gwt.client.UIDL, com.vaadin.terminal.gwt.client.ApplicationConnection) */ + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { getWidget().rendering = true; @@ -180,6 +181,7 @@ public class TableConnector extends AbstractComponentContainerConnector // *shouldn't* have changed (unless the number of rows // or the height of the widget has also changed) Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { Util.runWebkitOverflowAutoFix(getWidget().scrollBodyPanel .getElement()); @@ -267,23 +269,28 @@ public class TableConnector extends AbstractComponentContainerConnector return (VScrollTable) super.getWidget(); } + @Override public void updateCaption(ComponentConnector component) { // NOP, not rendered } + @Override public void layoutVertically() { getWidget().updateHeight(); } + @Override public void layoutHorizontally() { getWidget().updateWidth(); } + @Override public void postLayout() { VScrollTable table = getWidget(); if (table.sizeNeedsInit) { table.sizeInit(); Scheduler.get().scheduleFinally(new ScheduledCommand() { + @Override public void execute() { getLayoutManager().setNeedsMeasure(TableConnector.this); ServerConnector parent = getParent(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java index e2aedd123f..4574a9ea44 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/table/VScrollTable.java @@ -328,6 +328,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private KeyPressHandler navKeyPressHandler = new KeyPressHandler() { + @Override public void onKeyPress(KeyPressEvent keyPressEvent) { // This is used for Firefox only, since Firefox auto-repeat // works correctly only if we use a key press handler, other @@ -365,6 +366,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private KeyUpHandler navKeyUpHandler = new KeyUpHandler() { + @Override public void onKeyUp(KeyUpEvent keyUpEvent) { NativeEvent event = keyUpEvent.getNativeEvent(); int keyCode = event.getKeyCode(); @@ -392,6 +394,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private KeyDownHandler navKeyDownHandler = new KeyDownHandler() { + @Override public void onKeyDown(KeyDownEvent keyDownEvent) { NativeEvent event = keyDownEvent.getNativeEvent(); // This is not used for Firefox @@ -520,6 +523,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, scrollBodyPanel.sinkEvents(Event.ONCONTEXTMENU); scrollBodyPanel.addDomHandler(new ContextMenuHandler() { + @Override public void onContextMenu(ContextMenuEvent event) { handleBodyContextMenu(event); } @@ -540,6 +544,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // closes. See #8526. client.getContextMenu().addCloseHandler(new CloseHandler() { + @Override public void onClose(CloseEvent event) { contextMenu = null; } @@ -1849,6 +1854,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Deferred due to some Firefox oddities Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { scrollBodyPanel .setScrollPosition(measureRowHeightOffset(firstvisible)); @@ -1884,6 +1890,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, scrollBody.reLayoutComponents(); Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { Util.runWebkitOverflowAutoFix(scrollBodyPanel.getElement()); } @@ -2215,6 +2222,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } else { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { int tdWidth = width + scrollBody.getCellExtraWidth(); @@ -2813,6 +2821,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, Scheduler.get().scheduleDeferred( new ScheduledCommand() { + @Override public void execute() { setColWidth(colIx, newWidth, true); } @@ -2841,6 +2850,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // Recalculate the column sizings if any column has changed Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { triggerLazyColumnAdjustment(true); } @@ -2952,6 +2962,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, visibleCells.add(newIndex, hCell); } + @Override public Iterator iterator() { return visibleCells.iterator(); } @@ -3101,6 +3112,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Returns columns as Action array for column select popup */ + @Override public Action[] getActions() { Object[] cols; if (columnReordering && columnOrder != null) { @@ -3139,10 +3151,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return actions; } + @Override public ApplicationConnection getClient() { return client; } + @Override public String getPaintableId() { return paintableId; } @@ -3310,6 +3324,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } else { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { int tdWidth = width + scrollBody.getCellExtraWidth() @@ -3573,6 +3588,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * @see com.google.gwt.user.client.ui.HasWidgets#iterator() */ + @Override public Iterator iterator() { return visibleCells.iterator(); } @@ -4111,6 +4127,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, renderedRows.add(actualIx, row); } + @Override public Iterator iterator() { return renderedRows.iterator(); } @@ -4704,6 +4721,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, childWidgets.add(w); } + @Override public Iterator iterator() { return childWidgets.iterator(); } @@ -5396,6 +5414,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * @see com.vaadin.terminal.gwt.client.ui.IActionOwner#getActions () */ + @Override public Action[] getActions() { if (actionKeys == null) { return new Action[] {}; @@ -5419,10 +5438,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return actions; } + @Override public ApplicationConnection getClient() { return client; } + @Override public String getPaintableId() { return paintableId; } @@ -5473,6 +5494,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // widths. Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { if (showRowHeaders) { setCellWidth(0, tHead.getHeaderCell(0).getWidth()); @@ -5804,6 +5826,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, scrollBody.reLayoutComponents(); Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { Util.runWebkitOverflowAutoFix(scrollBodyPanel.getElement()); } @@ -5925,6 +5948,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // #7607. Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { Util.runWebkitOverflowAutoFix(scrollBodyPanel.getElement()); } @@ -5955,6 +5979,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (visible) { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { scrollBodyPanel .setScrollPosition(measureRowHeightOffset(firstRowInViewPort)); @@ -5989,6 +6014,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * user scrolls */ + @Override public void onScroll(ScrollEvent event) { scrollLeft = scrollBodyPanel.getElement().getScrollLeft(); scrollTop = scrollBodyPanel.getScrollPosition(); @@ -6018,6 +6044,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // value available soon. Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { onScroll(null); } @@ -6098,6 +6125,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return (int) Math.ceil(scrollTop / scrollBody.getRowHeight()); } + @Override public VScrollTableDropHandler getDropHandler() { return dropHandler; } @@ -6178,6 +6206,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, final TableDDDetails newDetails = dropDetails; VAcceptCallback cb = new VAcceptCallback() { + @Override public void accepted(VDragEvent event) { if (newDetails.equals(dropDetails)) { dragAccepted(event); @@ -6254,6 +6283,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return ConnectorMap.get(client).getConnector(VScrollTable.this); } + @Override public ApplicationConnection getApplicationConnection() { return client; } @@ -6585,6 +6615,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * .dom.client.FocusEvent) */ + @Override public void onFocus(FocusEvent event) { if (isFocusable()) { hasFocus = true; @@ -6606,6 +6637,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * .dom.client.BlurEvent) */ + @Override public void onBlur(BlurEvent event) { hasFocus = false; navKeyDown = false; @@ -6679,6 +6711,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * @see com.vaadin.terminal.gwt.client.Focusable#focus() */ + @Override public void focus() { if (isFocusable()) { scrollBodyPanel.focus(); @@ -6760,6 +6793,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, public void lazyRevertFocusToRow(final VScrollTableRow currentlyFocusedRow) { Scheduler.get().scheduleFinally(new ScheduledCommand() { + @Override public void execute() { if (currentlyFocusedRow != null) { setRowFocus(currentlyFocusedRow); @@ -6772,6 +6806,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, }); } + @Override public Action[] getActions() { if (bodyActionKeys == null) { return new Action[] {}; @@ -6787,10 +6822,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, return actions; } + @Override public ApplicationConnection getClient() { return client; } + @Override public String getPaintableId() { return paintableId; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetBaseConnector.java b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetBaseConnector.java index e16e84d112..ea0bea6b04 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetBaseConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetBaseConnector.java @@ -22,6 +22,7 @@ public abstract class TabsheetBaseConnector extends public static final String ATTRIBUTE_TAB_CAPTION = "caption"; public static final String ATTRIBUTE_TAB_ICON = "icon"; + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { getWidget().client = client; diff --git a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java index 51a7801f91..a4de77c495 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/TabsheetConnector.java @@ -68,10 +68,12 @@ public class TabsheetConnector extends TabsheetBaseConnector implements return (VTabsheet) super.getWidget(); } + @Override public void updateCaption(ComponentConnector component) { /* Tabsheet does not render its children's captions */ } + @Override public void layout() { VTabsheet tabsheet = getWidget(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java index 844708a892..bbbffefa40 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tabsheet/VTabsheet.java @@ -212,14 +212,17 @@ public class VTabsheet extends VTabsheetBase implements Focusable, tabCaption.setWidth(tabCaption.getRequiredWidth() + "px"); } + @Override public HandlerRegistration addFocusHandler(FocusHandler handler) { return addDomHandler(handler, FocusEvent.getType()); } + @Override public HandlerRegistration addBlurHandler(BlurHandler handler) { return addDomHandler(handler, BlurEvent.getType()); } + @Override public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) { return addDomHandler(handler, KeyDownEvent.getType()); } @@ -356,6 +359,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, setElement(el); } + @Override public void onClose(VCloseEvent event) { Tab tab = event.getTab(); if (!tab.isEnabledOnServer()) { @@ -391,6 +395,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, return t; } + @Override public void onClick(ClickEvent event) { TabCaption caption = (TabCaption) event.getSource(); Element targetElement = event.getNativeEvent().getEventTarget() @@ -1031,6 +1036,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, style.setProperty("whiteSpace", "normal"); Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { style.setProperty("whiteSpace", ""); } @@ -1115,6 +1121,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } } + @Override public void onBlur(BlurEvent event) { if (focusedTab != null && event.getSource() instanceof Tab) { focusedTab = null; @@ -1124,6 +1131,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } } + @Override public void onFocus(FocusEvent event) { if (focusedTab == null && event.getSource() instanceof Tab) { focusedTab = (Tab) event.getSource(); @@ -1133,6 +1141,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } } + @Override public void focus() { tb.getTab(activeTabIndex).focus(); } @@ -1141,6 +1150,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, tb.getTab(activeTabIndex).blur(); } + @Override public void onKeyDown(KeyDownEvent event) { if (event.getSource() instanceof Tab) { int keycode = event.getNativeEvent().getKeyCode(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/textarea/VTextArea.java b/src/com/vaadin/terminal/gwt/client/ui/textarea/VTextArea.java index aede1ef002..c0f6deab53 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/textarea/VTextArea.java +++ b/src/com/vaadin/terminal/gwt/client/ui/textarea/VTextArea.java @@ -57,6 +57,7 @@ public class VTextArea extends VTextField { public void onBrowserEvent(Event event) { if (getMaxLength() >= 0 && event.getTypeInt() == Event.ONKEYUP) { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { if (getText().length() > getMaxLength()) { setText(getText().substring(0, getMaxLength())); diff --git a/src/com/vaadin/terminal/gwt/client/ui/textfield/TextFieldConnector.java b/src/com/vaadin/terminal/gwt/client/ui/textfield/TextFieldConnector.java index 04bf029b05..bf4c921109 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/textfield/TextFieldConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/textfield/TextFieldConnector.java @@ -25,6 +25,7 @@ public class TextFieldConnector extends AbstractFieldConnector implements return (AbstractTextFieldState) super.getState(); } + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { // Save details getWidget().client = client; @@ -83,6 +84,7 @@ public class TextFieldConnector extends AbstractFieldConnector implements * Gecko defers setting the text so we need to defer the selection. */ Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { getWidget().setSelectionRange(pos, length); } @@ -95,6 +97,7 @@ public class TextFieldConnector extends AbstractFieldConnector implements return (VTextField) super.getWidget(); } + @Override public void onBeforeShortcutAction(Event e) { getWidget().valueChange(false); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java b/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java index bd55c26a24..4050f1bafc 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java +++ b/src/com/vaadin/terminal/gwt/client/ui/textfield/VTextField.java @@ -274,6 +274,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, return maxLength; } + @Override public void onChange(ChangeEvent event) { valueChange(false); } @@ -349,6 +350,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, } } + @Override public void onFocus(FocusEvent event) { addStyleDependentName(CLASSNAME_FOCUS); if (prompting) { @@ -362,6 +364,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, } } + @Override public void onBlur(BlurEvent event) { removeStyleDependentName(CLASSNAME_FOCUS); focusedTextField = null; @@ -387,6 +390,7 @@ public class VTextField extends TextBoxBase implements Field, ChangeHandler, setWidth(columns + "em"); } + @Override public void onKeyDown(KeyDownEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { valueChange(false); diff --git a/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java b/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java index 3f96a61bf3..2543838f89 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tree/TreeConnector.java @@ -33,6 +33,7 @@ public class TreeConnector extends AbstractComponentConnector implements protected final Map tooltipMap = new HashMap(); + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; diff --git a/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java b/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java index 7462160bad..2c3b105cc0 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java +++ b/src/com/vaadin/terminal/gwt/client/ui/tree/VTree.java @@ -126,6 +126,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, public VLazyExecutor iconLoaded = new VLazyExecutor(50, new ScheduledCommand() { + @Override public void execute() { Util.notifyParentOfSizeChange(VTree.this, true); } @@ -145,6 +146,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, */ sinkEvents(Event.ONCONTEXTMENU); addDomHandler(new ContextMenuHandler() { + @Override public void onContextMenu(ContextMenuEvent event) { handleBodyContextMenu(event); } @@ -333,6 +335,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } if (newKey != null) { validate(new VAcceptCallback() { + @Override public void accepted(VDragEvent event) { VerticalDropLocation curDetail = (VerticalDropLocation) event .getDropDetails().get("detail"); @@ -376,6 +379,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, return ConnectorMap.get(client).getConnector(VTree.this); } + @Override public ApplicationConnection getApplicationConnection() { return client; } @@ -419,6 +423,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, */ private void sendSelectionToServer() { Command command = new Command() { + @Override public void execute() { client.updateVariable(paintableId, "selected", selectedIds.toArray(new String[selectedIds.size()]), @@ -586,6 +591,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } ScheduledCommand command = new ScheduledCommand() { + @Override public void execute() { if (multiSelectMode == MULTISELECT_MODE_SIMPLE @@ -776,6 +782,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, final MouseEventDetails details = MouseEventDetailsBuilder .buildMouseEventDetails(evt); ScheduledCommand command = new ScheduledCommand() { + @Override public void execute() { // Determine if we should send the event immediately to the // server. We do not want to send the event if there is a @@ -919,6 +926,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, return nodes; } + @Override public Action[] getActions() { if (actionKeys == null) { return new Action[] {}; @@ -935,10 +943,12 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, return actions; } + @Override public ApplicationConnection getClient() { return client; } + @Override public String getPaintableId() { return paintableId; } @@ -1076,6 +1086,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, } + @Override public VDropHandler getDropHandler() { return dropHandler; } @@ -1485,6 +1496,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, node.scrollIntoView(); } else { Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { focusedNode.scrollIntoView(); } @@ -1510,6 +1522,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) */ + @Override public void onFocus(FocusEvent event) { treeHasFocus = true; // If no node has focus, focus the first item in the tree @@ -1529,6 +1542,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event * .dom.client.BlurEvent) */ + @Override public void onBlur(BlurEvent event) { treeHasFocus = false; if (focusedNode != null) { @@ -1543,6 +1557,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * com.google.gwt.event.dom.client.KeyPressHandler#onKeyPress(com.google * .gwt.event.dom.client.KeyPressEvent) */ + @Override public void onKeyPress(KeyPressEvent event) { NativeEvent nativeEvent = event.getNativeEvent(); int keyCode = nativeEvent.getKeyCode(); @@ -1566,6 +1581,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) */ + @Override public void onKeyDown(KeyDownEvent event) { if (handleKeyNavigation(event.getNativeEvent().getKeyCode(), event.isControlKeyDown() || event.isMetaKeyDown(), @@ -1946,6 +1962,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * com.vaadin.terminal.gwt.client.ui.SubPartAware#getSubPartElement(java * .lang.String) */ + @Override public Element getSubPartElement(String subPart) { if ("fe".equals(subPart)) { if (BrowserInfo.get().isOpera() && focusedNode != null) { @@ -1999,6 +2016,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, * com.vaadin.terminal.gwt.client.ui.SubPartAware#getSubPartName(com.google * .gwt.user.client.Element) */ + @Override public String getSubPartName(Element subElement) { // Supported identifiers: // @@ -2049,6 +2067,7 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, return locator; } + @Override public Action[] getActions() { if (bodyActionKeys == null) { return new Action[] {}; @@ -2064,10 +2083,12 @@ public class VTree extends FocusElementPanel implements VHasDropHandler, return actions; } + @Override public ApplicationConnection getClient() { return client; } + @Override public String getPaintableId() { return paintableId; } diff --git a/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java b/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java index 9a8e0e9ce1..91e1fe2a3d 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java +++ b/src/com/vaadin/terminal/gwt/client/ui/treetable/VTreeTable.java @@ -257,6 +257,7 @@ public class VTreeTable extends VScrollTable { // widths. Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override public void execute() { if (showRowHeaders) { setCellWidth(0, tHead.getHeaderCell(0).getWidth()); diff --git a/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java b/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java index 6d5cd3320e..55234f5425 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/twincolselect/TwinColSelectConnector.java @@ -45,6 +45,7 @@ public class TwinColSelectConnector extends OptionGroupBaseConnector implements return (VTwinColSelect) super.getWidget(); } + @Override public void layoutVertically() { if (isUndefinedHeight()) { getWidget().clearInternalHeights(); @@ -53,6 +54,7 @@ public class TwinColSelectConnector extends OptionGroupBaseConnector implements } } + @Override public void layoutHorizontally() { if (isUndefinedWidth()) { getWidget().clearInternalWidths(); diff --git a/src/com/vaadin/terminal/gwt/client/ui/twincolselect/VTwinColSelect.java b/src/com/vaadin/terminal/gwt/client/ui/twincolselect/VTwinColSelect.java index 8f1ea09b8f..1a2deae3b4 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/twincolselect/VTwinColSelect.java +++ b/src/com/vaadin/terminal/gwt/client/ui/twincolselect/VTwinColSelect.java @@ -409,6 +409,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, remove.setTabIndex(tabIndex); } + @Override public void focus() { options.setFocus(true); } @@ -430,6 +431,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) */ + @Override public void onKeyDown(KeyDownEvent event) { int keycode = event.getNativeKeyCode(); @@ -493,6 +495,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, * com.google.gwt.event.dom.client.MouseDownHandler#onMouseDown(com.google * .gwt.event.dom.client.MouseDownEvent) */ + @Override public void onMouseDown(MouseDownEvent event) { // Ensure that items are deselected when selecting // from a different source. See #3699 for details. @@ -515,6 +518,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, * com.google.gwt.event.dom.client.DoubleClickHandler#onDoubleClick(com. * google.gwt.event.dom.client.DoubleClickEvent) */ + @Override public void onDoubleClick(DoubleClickEvent event) { if (event.getSource() == options) { addItem(); @@ -539,6 +543,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, private static final String SUBPART_ADD_BUTTON = "add"; private static final String SUBPART_REMOVE_BUTTON = "remove"; + @Override public Element getSubPartElement(String subPart) { if (SUBPART_OPTION_SELECT.equals(subPart)) { return options.getElement(); @@ -568,6 +573,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, return null; } + @Override public String getSubPartName(Element subElement) { if (optionsCaption != null && optionsCaption.getElement().isOrHasChild(subElement)) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/upload/UploadConnector.java b/src/com/vaadin/terminal/gwt/client/ui/upload/UploadConnector.java index 153d99229b..c17c81c2dd 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/upload/UploadConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/upload/UploadConnector.java @@ -16,6 +16,7 @@ import com.vaadin.ui.Upload; public class UploadConnector extends AbstractComponentConnector implements Paintable { + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { if (!isRealUpdate(uidl)) { return; diff --git a/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java b/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java index ac475ce5a5..5cf2f2fe25 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java +++ b/src/com/vaadin/terminal/gwt/client/ui/upload/VUpload.java @@ -115,6 +115,7 @@ public class VUpload extends SimplePanel { panel.add(fu); submitButton = new VButton(); submitButton.addClickHandler(new ClickHandler() { + @Override public void onClick(ClickEvent event) { if (immediate) { // fire click on upload (eg. focused button and hit space) @@ -203,6 +204,7 @@ public class VUpload extends SimplePanel { private void onSubmitComplete() { /* Needs to be run dereferred to avoid various browser issues. */ Scheduler.get().scheduleDeferred(new Command() { + @Override public void execute() { if (submitted) { if (client != null) { diff --git a/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java b/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java index 3946a026c6..7bdc7cc066 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java +++ b/src/com/vaadin/terminal/gwt/client/ui/window/VWindow.java @@ -146,6 +146,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, private VLazyExecutor delayedContentsSizeUpdater = new VLazyExecutor(200, new ScheduledCommand() { + @Override public void execute() { updateContentsSize(); } @@ -266,6 +267,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, orderingDefered = true; Scheduler.get().scheduleFinally(new Command() { + @Override public void execute() { doServerSideOrdering(); VNotification.bringNotificationsToFront(); @@ -279,6 +281,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, VWindow[] array = windowOrder.toArray(new VWindow[windowOrder.size()]); Arrays.sort(array, new Comparator() { + @Override public int compare(VWindow o1, VWindow o2) { /* * Order by modality, then by bringtofront sequence. @@ -851,10 +854,12 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, true); } + @Override public ShortcutActionHandler getShortcutActionHandler() { return shortcutHandler; } + @Override public void onScroll(ScrollEvent event) { client.updateVariable(id, "scrollTop", contentPanel.getScrollPosition(), false); @@ -863,6 +868,7 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } + @Override public void onKeyDown(KeyDownEvent event) { if (shortcutHandler != null) { shortcutHandler @@ -871,18 +877,21 @@ public class VWindow extends VOverlay implements ShortcutActionHandlerOwner, } } + @Override public void onBlur(BlurEvent event) { if (client.hasEventListeners(this, EventId.BLUR)) { client.updateVariable(id, EventId.BLUR, "", true); } } + @Override public void onFocus(FocusEvent event) { if (client.hasEventListeners(this, EventId.FOCUS)) { client.updateVariable(id, EventId.FOCUS, "", true); } } + @Override public void focus() { contentPanel.focus(); } diff --git a/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java b/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java index 83de039f0b..16cdaa9cad 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java +++ b/src/com/vaadin/terminal/gwt/client/ui/window/WindowConnector.java @@ -72,6 +72,7 @@ public class WindowConnector extends AbstractComponentContainerConnector lm.unregisterDependency(this, window.footer); } + @Override public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { getWidget().id = getConnectorId(); getWidget().client = client; @@ -180,10 +181,12 @@ public class WindowConnector extends AbstractComponentContainerConnector } } + @Override public void updateCaption(ComponentConnector component) { // NOP, window has own caption, layout caption not rendered } + @Override public void onBeforeShortcutAction(Event e) { // NOP, nothing to update just avoid workaround ( causes excess // blur/focus ) @@ -210,6 +213,7 @@ public class WindowConnector extends AbstractComponentContainerConnector getWidget().contentPanel.setWidget(newChildWidget); } + @Override public void layout() { LayoutManager lm = getLayoutManager(); VWindow window = getWidget(); @@ -274,6 +278,7 @@ public class WindowConnector extends AbstractComponentContainerConnector } } + @Override public void postLayout() { minWidthChecked = false; VWindow window = getWidget(); diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index acfc926d68..3fcd61036f 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -175,6 +175,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet this.portlet = portlet; } + @Override public void criticalNotification(WrappedRequest request, WrappedResponse response, String cap, String msg, String details, String outOfSyncURL) throws IOException { @@ -213,6 +214,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet private DeploymentConfiguration deploymentConfiguration = new DeploymentConfiguration() { + @Override public String getConfiguredWidgetset(WrappedRequest request) { String widgetset = getApplicationOrSystemProperty( @@ -233,6 +235,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet return widgetset; } + @Override public String getConfiguredTheme(WrappedRequest request) { // is the default theme defined by the portal? @@ -247,12 +250,14 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet return themeName; } + @Override public String getApplicationOrSystemProperty(String propertyName, String defaultValue) { return AbstractApplicationPortlet.this .getApplicationOrSystemProperty(propertyName, defaultValue); } + @Override public boolean isStandalone(WrappedRequest request) { return false; } @@ -272,6 +277,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet * be a VAADIN directory). Does not end with a slash (/). */ + @Override public String getStaticFileLocation(WrappedRequest request) { String staticFileLocation = WrappedPortletRequest.cast(request) .getPortalProperty( @@ -289,6 +295,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } } + @Override public ClassLoader getClassLoader() { // Custom class loaders not currently supported in portlets (see // #8574) @@ -1067,6 +1074,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet this.throwable = throwable; } + @Override public Throwable getThrowable() { return throwable; } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index f61f40dccc..27768ed8b5 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -74,6 +74,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements this.servlet = servlet; } + @Override public void criticalNotification(WrappedRequest request, WrappedResponse response, String cap, String msg, String details, String outOfSyncURL) throws IOException { @@ -97,6 +98,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements private DeploymentConfiguration deploymentConfiguration = new DeploymentConfiguration() { + @Override public String getStaticFileLocation(WrappedRequest request) { HttpServletRequest servletRequest = WrappedHttpServletRequest .cast(request); @@ -104,27 +106,32 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements .getStaticFilesLocation(servletRequest); } + @Override public String getConfiguredWidgetset(WrappedRequest request) { return getApplicationOrSystemProperty( AbstractApplicationServlet.PARAMETER_WIDGETSET, AbstractApplicationServlet.DEFAULT_WIDGETSET); } + @Override public String getConfiguredTheme(WrappedRequest request) { // Use the default return AbstractApplicationServlet.getDefaultTheme(); } + @Override public String getApplicationOrSystemProperty(String propertyName, String defaultValue) { return AbstractApplicationServlet.this .getApplicationOrSystemProperty(propertyName, defaultValue); } + @Override public boolean isStandalone(WrappedRequest request) { return true; } + @Override public ClassLoader getClassLoader() { try { return AbstractApplicationServlet.this.getClassLoader(); @@ -1706,6 +1713,7 @@ public abstract class AbstractApplicationServlet extends HttpServlet implements this.throwable = throwable; } + @Override public Throwable getThrowable() { return throwable; } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 996ada924d..76dab13502 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1164,6 +1164,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * defined by super class is already loaded. */ Collections.sort(newConnectorTypes, new Comparator>() { + @Override public int compare(Class o1, Class o2) { // TODO optimize using Class.isAssignableFrom? return hierarchyDepth(o1) - hierarchyDepth(o2); @@ -1307,6 +1308,7 @@ public abstract class AbstractCommunicationManager implements Serializable { // before children start calling e.g. updateCaption Collections.sort(paintables, new Comparator() { + @Override public int compare(Component c1, Component c2) { int depth1 = 0; while (c1.getParent() != null) { @@ -1393,14 +1395,17 @@ public abstract class AbstractCommunicationManager implements Serializable { private static class NullIterator implements Iterator { + @Override public boolean hasNext() { return false; } + @Override public E next() { return null; } + @Override public void remove() { } @@ -1874,6 +1879,7 @@ public abstract class AbstractCommunicationManager implements Serializable { this.throwable = throwable; } + @Override public Throwable getThrowable() { return throwable; } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java b/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java index 43b175cc36..d3474e736e 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java @@ -15,10 +15,12 @@ abstract class AbstractStreamingEvent implements StreamingEvent { private final long contentLength; private final long bytesReceived; + @Override public final String getFileName() { return filename; } + @Override public final String getMimeType() { return type; } @@ -31,10 +33,12 @@ abstract class AbstractStreamingEvent implements StreamingEvent { this.bytesReceived = bytesReceived; } + @Override public final long getContentLength() { return contentLength; } + @Override public final long getBytesReceived() { return bytesReceived; } diff --git a/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java b/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java index bf4ea860a8..73d45f62b1 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java @@ -45,12 +45,14 @@ public abstract class AbstractWebApplicationContext implements private long lastRequestTime = -1; + @Override public void addTransactionListener(TransactionListener listener) { if (listener != null) { listeners.add(listener); } } + @Override public void removeTransactionListener(TransactionListener listener) { listeners.remove(listener); } @@ -119,6 +121,7 @@ public abstract class AbstractWebApplicationContext implements /** * @see javax.servlet.http.HttpSessionBindingListener#valueBound(HttpSessionBindingEvent) */ + @Override public void valueBound(HttpSessionBindingEvent arg0) { // We are not interested in bindings } @@ -126,6 +129,7 @@ public abstract class AbstractWebApplicationContext implements /** * @see javax.servlet.http.HttpSessionBindingListener#valueUnbound(HttpSessionBindingEvent) */ + @Override public void valueUnbound(HttpSessionBindingEvent event) { // If we are going to be unbound from the session, the session must be // closing @@ -160,6 +164,7 @@ public abstract class AbstractWebApplicationContext implements return browser; } + @Override public Collection getApplications() { return Collections.unmodifiableCollection(applications); } @@ -169,6 +174,7 @@ public abstract class AbstractWebApplicationContext implements applicationToAjaxAppMgrMap.remove(application); } + @Override public String generateApplicationResourceURL(ApplicationResource resource, String mapKey) { @@ -197,6 +203,7 @@ public abstract class AbstractWebApplicationContext implements } } + @Override public boolean isApplicationResourceURL(URL context, String relativeUri) { // If the relative uri is null, we are ready if (relativeUri == null) { @@ -214,6 +221,7 @@ public abstract class AbstractWebApplicationContext implements return (prefix.equals("APP")); } + @Override public String getURLKey(URL context, String relativeUri) { final int index = relativeUri.indexOf('/'); final int next = relativeUri.indexOf('/', index + 1); diff --git a/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java b/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java index 7cf66d5fcf..42726c933e 100644 --- a/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java +++ b/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java @@ -21,6 +21,7 @@ public class ApplicationResourceHandler implements RequestHandler { private static final Pattern APP_RESOURCE_PATTERN = Pattern .compile("^/?APP/(\\d+)/.*"); + @Override public boolean handleRequest(Application application, WrappedRequest request, WrappedResponse response) throws IOException { diff --git a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java index d32fa325f4..4038b8f1bc 100644 --- a/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java +++ b/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java @@ -113,6 +113,7 @@ public abstract class BootstrapHandler implements RequestHandler { } + @Override public boolean handleRequest(Application application, WrappedRequest request, WrappedResponse response) throws IOException { diff --git a/src/com/vaadin/terminal/gwt/server/ChangeVariablesErrorEvent.java b/src/com/vaadin/terminal/gwt/server/ChangeVariablesErrorEvent.java index b6576dce9f..8f0c80332f 100644 --- a/src/com/vaadin/terminal/gwt/server/ChangeVariablesErrorEvent.java +++ b/src/com/vaadin/terminal/gwt/server/ChangeVariablesErrorEvent.java @@ -23,6 +23,7 @@ public class ChangeVariablesErrorEvent implements ComponentErrorEvent { this.variableChanges = variableChanges; } + @Override public Throwable getThrowable() { return throwable; } diff --git a/src/com/vaadin/terminal/gwt/server/ClientConnector.java b/src/com/vaadin/terminal/gwt/server/ClientConnector.java index ca1ad349c1..1e9166261f 100644 --- a/src/com/vaadin/terminal/gwt/server/ClientConnector.java +++ b/src/com/vaadin/terminal/gwt/server/ClientConnector.java @@ -48,6 +48,7 @@ public interface ClientConnector extends Connector, RpcTarget { */ public Class getStateType(); + @Override public ClientConnector getParent(); /** diff --git a/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java b/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java index ad9484723b..64ea288665 100644 --- a/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java +++ b/src/com/vaadin/terminal/gwt/server/ClientMethodInvocation.java @@ -61,6 +61,7 @@ public class ClientMethodInvocation implements Serializable, return sequenceNumber; } + @Override public int compareTo(ClientMethodInvocation o) { if (null == o) { return 0; diff --git a/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/src/com/vaadin/terminal/gwt/server/DragAndDropService.java index 8e0346f6af..949fd4b757 100644 --- a/src/com/vaadin/terminal/gwt/server/DragAndDropService.java +++ b/src/com/vaadin/terminal/gwt/server/DragAndDropService.java @@ -44,6 +44,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { this.manager = manager; } + @Override public void changeVariables(Object source, Map variables) { Object owner = variables.get("dhowner"); @@ -182,10 +183,12 @@ public class DragAndDropService implements VariableOwner, ClientConnector { return transferable; } + @Override public boolean isEnabled() { return isConnectorEnabled(); } + @Override public boolean isImmediate() { return true; } @@ -219,68 +222,82 @@ public class DragAndDropService implements VariableOwner, ClientConnector { return false; } + @Override public SharedState getState() { // TODO Auto-generated method stub return null; } + @Override public String getConnectorId() { return VDragAndDropManager.DD_SERVICE; } + @Override public boolean isConnectorEnabled() { // Drag'n'drop can't be disabled return true; } + @Override public List retrievePendingRpcCalls() { return null; } + @Override public RpcManager getRpcManager(Class rpcInterface) { // TODO Use rpc for drag'n'drop return null; } + @Override public Class getStateType() { return SharedState.class; } + @Override public void requestRepaint() { // TODO Auto-generated method stub } + @Override public ClientConnector getParent() { // TODO Auto-generated method stub return null; } + @Override public void requestRepaintAll() { // TODO Auto-generated method stub } + @Override public void setParent(ClientConnector parent) { // TODO Auto-generated method stub } + @Override public void attach() { // TODO Auto-generated method stub } + @Override public void detach() { // TODO Auto-generated method stub } + @Override public Collection getExtensions() { // TODO Auto-generated method stub return Collections.emptySet(); } + @Override public void removeExtension(Extension extension) { // TODO Auto-generated method stub } @@ -289,6 +306,7 @@ public class DragAndDropService implements VariableOwner, ClientConnector { return Logger.getLogger(DragAndDropService.class.getName()); } + @Override public Root getRoot() { return null; } diff --git a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java index 15b5ced703..aed1c2c0e3 100644 --- a/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java +++ b/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java @@ -103,6 +103,7 @@ public class JsonPaintTarget implements PaintTarget { cacheEnabled = cachingRequired; } + @Override public void startTag(String tagName) throws PaintException { startTag(tagName, false); } @@ -159,6 +160,7 @@ public class JsonPaintTarget implements PaintTarget { * if the paint operation failed. */ + @Override public void endTag(String tagName) throws PaintException { // In case of null data output nothing: if (tagName == null) { @@ -326,14 +328,17 @@ public class JsonPaintTarget implements PaintTarget { * */ + @Override public void addText(String str) throws PaintException { tag.addData("\"" + escapeJSON(str) + "\""); } + @Override public void addAttribute(String name, boolean value) throws PaintException { tag.addAttribute("\"" + name + "\":" + (value ? "true" : "false")); } + @Override @SuppressWarnings("deprecation") public void addAttribute(String name, Resource value) throws PaintException { @@ -363,22 +368,27 @@ public class JsonPaintTarget implements PaintTarget { } + @Override public void addAttribute(String name, int value) throws PaintException { tag.addAttribute("\"" + name + "\":" + String.valueOf(value)); } + @Override public void addAttribute(String name, long value) throws PaintException { tag.addAttribute("\"" + name + "\":" + String.valueOf(value)); } + @Override public void addAttribute(String name, float value) throws PaintException { tag.addAttribute("\"" + name + "\":" + String.valueOf(value)); } + @Override public void addAttribute(String name, double value) throws PaintException { tag.addAttribute("\"" + name + "\":" + String.valueOf(value)); } + @Override public void addAttribute(String name, String value) throws PaintException { // In case of null data output nothing: if ((value == null) || (name == null)) { @@ -398,12 +408,14 @@ public class JsonPaintTarget implements PaintTarget { } + @Override public void addAttribute(String name, Component value) throws PaintException { final String id = value.getConnectorId(); addAttribute(name, id); } + @Override public void addAttribute(String name, Map value) throws PaintException { @@ -441,6 +453,7 @@ public class JsonPaintTarget implements PaintTarget { tag.addAttribute(sb.toString()); } + @Override public void addAttribute(String name, Object[] values) { // In case of null data output nothing: if ((values == null) || (name == null)) { @@ -461,41 +474,49 @@ public class JsonPaintTarget implements PaintTarget { tag.addAttribute(buf.toString()); } + @Override public void addVariable(VariableOwner owner, String name, String value) throws PaintException { tag.addVariable(new StringVariable(owner, name, escapeJSON(value))); } + @Override public void addVariable(VariableOwner owner, String name, Component value) throws PaintException { tag.addVariable(new StringVariable(owner, name, value.getConnectorId())); } + @Override public void addVariable(VariableOwner owner, String name, int value) throws PaintException { tag.addVariable(new IntVariable(owner, name, value)); } + @Override public void addVariable(VariableOwner owner, String name, long value) throws PaintException { tag.addVariable(new LongVariable(owner, name, value)); } + @Override public void addVariable(VariableOwner owner, String name, float value) throws PaintException { tag.addVariable(new FloatVariable(owner, name, value)); } + @Override public void addVariable(VariableOwner owner, String name, double value) throws PaintException { tag.addVariable(new DoubleVariable(owner, name, value)); } + @Override public void addVariable(VariableOwner owner, String name, boolean value) throws PaintException { tag.addVariable(new BooleanVariable(owner, name, value)); } + @Override public void addVariable(VariableOwner owner, String name, String[] value) throws PaintException { tag.addVariable(new ArrayVariable(owner, name, value)); @@ -515,6 +536,7 @@ public class JsonPaintTarget implements PaintTarget { * if the paint operation failed. */ + @Override public void addUploadStreamVariable(VariableOwner owner, String name) throws PaintException { startTag("uploadstream"); @@ -535,6 +557,7 @@ public class JsonPaintTarget implements PaintTarget { * if the paint operation failed. */ + @Override public void addSection(String sectionTagName, String sectionData) throws PaintException { tag.addData("{\"" + sectionTagName + "\":\"" + escapeJSON(sectionData) @@ -550,6 +573,7 @@ public class JsonPaintTarget implements PaintTarget { * if the paint operation failed. */ + @Override public void addUIDL(String xml) throws PaintException { // Ensure that the target is open @@ -584,6 +608,7 @@ public class JsonPaintTarget implements PaintTarget { * String) */ + @Override public void addXMLSection(String sectionTagName, String sectionData, String namespace) throws PaintException { @@ -649,6 +674,7 @@ public class JsonPaintTarget implements PaintTarget { * .Paintable, java.lang.String) */ + @Override public PaintStatus startPaintable(Component connector, String tagName) throws PaintException { boolean topLevelPaintable = openPaintables.isEmpty(); @@ -675,6 +701,7 @@ public class JsonPaintTarget implements PaintTarget { return PaintStatus.PAINTING; } + @Override public void endPaintable(Component paintable) throws PaintException { getLogger().fine( "endPaintable for " + paintable.getClass().getName() + "@" @@ -698,6 +725,7 @@ public class JsonPaintTarget implements PaintTarget { * @see com.vaadin.terminal.PaintTarget#addCharacterData(java.lang.String ) */ + @Override public void addCharacterData(String text) throws PaintException { if (text != null) { tag.addData(text); @@ -967,6 +995,7 @@ public class JsonPaintTarget implements PaintTarget { return usedResources; } + @Override @SuppressWarnings("unchecked") public String getTag(ClientConnector clientConnector) { Class clientConnectorClass = clientConnector @@ -989,6 +1018,7 @@ public class JsonPaintTarget implements PaintTarget { return usedClientConnectors; } + @Override public void addVariable(VariableOwner owner, String name, StreamVariable value) throws PaintException { String url = manager.getStreamVariableTargetUrl( @@ -1005,6 +1035,7 @@ public class JsonPaintTarget implements PaintTarget { * @see com.vaadin.terminal.PaintTarget#isFullRepaint() */ + @Override public boolean isFullRepaint() { return !cacheEnabled; } diff --git a/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java b/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java index de4f918b75..b888ad8e2d 100644 --- a/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java +++ b/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java @@ -63,6 +63,7 @@ public class PortletApplicationContext2 extends AbstractWebApplicationContext { private final Map sharedParameterActionNameMap = new HashMap(); private final Map sharedParameterActionValueMap = new HashMap(); + @Override public File getBaseDirectory() { String resultPath = session.getPortletContext().getRealPath("/"); if (resultPath != null) { diff --git a/src/com/vaadin/terminal/gwt/server/RestrictedRenderResponse.java b/src/com/vaadin/terminal/gwt/server/RestrictedRenderResponse.java index c4ef3fc8e5..9fdffbf9a5 100644 --- a/src/com/vaadin/terminal/gwt/server/RestrictedRenderResponse.java +++ b/src/com/vaadin/terminal/gwt/server/RestrictedRenderResponse.java @@ -34,112 +34,137 @@ class RestrictedRenderResponse implements RenderResponse, Serializable { this.response = response; } + @Override public void addProperty(String key, String value) { response.addProperty(key, value); } + @Override public PortletURL createActionURL() { return response.createActionURL(); } + @Override public PortletURL createRenderURL() { return response.createRenderURL(); } + @Override public String encodeURL(String path) { return response.encodeURL(path); } + @Override public void flushBuffer() throws IOException { // NOP // TODO throw? } + @Override public int getBufferSize() { return response.getBufferSize(); } + @Override public String getCharacterEncoding() { return response.getCharacterEncoding(); } + @Override public String getContentType() { return response.getContentType(); } + @Override public Locale getLocale() { return response.getLocale(); } + @Override public String getNamespace() { return response.getNamespace(); } + @Override public OutputStream getPortletOutputStream() throws IOException { // write forbidden return null; } + @Override public PrintWriter getWriter() throws IOException { // write forbidden return null; } + @Override public boolean isCommitted() { return response.isCommitted(); } + @Override public void reset() { // NOP // TODO throw? } + @Override public void resetBuffer() { // NOP // TODO throw? } + @Override public void setBufferSize(int size) { // NOP // TODO throw? } + @Override public void setContentType(String type) { // NOP // TODO throw? } + @Override public void setProperty(String key, String value) { response.setProperty(key, value); } + @Override public void setTitle(String title) { response.setTitle(title); } + @Override public void setNextPossiblePortletModes(Collection portletModes) { // NOP // TODO throw? } + @Override public ResourceURL createResourceURL() { return response.createResourceURL(); } + @Override public CacheControl getCacheControl() { return response.getCacheControl(); } + @Override public void addProperty(Cookie cookie) { // NOP // TODO throw? } + @Override public void addProperty(String key, Element element) { // NOP // TODO throw? } + @Override public Element createElement(String tagName) throws DOMException { // NOP return null; diff --git a/src/com/vaadin/terminal/gwt/server/ServerRpcManager.java b/src/com/vaadin/terminal/gwt/server/ServerRpcManager.java index d9931a9610..0e40ceb8fa 100644 --- a/src/com/vaadin/terminal/gwt/server/ServerRpcManager.java +++ b/src/com/vaadin/terminal/gwt/server/ServerRpcManager.java @@ -111,6 +111,7 @@ public class ServerRpcManager implements RpcManager { * @param invocation * method invocation to perform */ + @Override public void applyInvocation(ServerRpcMethodInvocation invocation) throws RpcInvocationException { Method method = invocation.getMethod(); diff --git a/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java b/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java index 7418867fc8..6ab3df2789 100644 --- a/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java +++ b/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java @@ -17,6 +17,7 @@ final class StreamingErrorEventImpl extends AbstractStreamingEvent implements this.exception = exception; } + @Override public final Exception getException() { return exception; } diff --git a/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java b/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java index 6a7844abd0..274d05e111 100644 --- a/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java +++ b/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java @@ -16,6 +16,7 @@ final class StreamingStartEventImpl extends AbstractStreamingEvent implements super(filename, type, contentLength, 0); } + @Override public void disposeStreamVariable() { disposed = true; } diff --git a/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java b/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java index 334a7acf8d..5248af595e 100644 --- a/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java +++ b/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java @@ -26,6 +26,7 @@ public class UnsupportedBrowserHandler implements RequestHandler { /** Cookie used to ignore browser checks */ public static final String FORCE_LOAD_COOKIE = "vaadinforceload=1"; + @Override public boolean handleRequest(Application application, WrappedRequest request, WrappedResponse response) throws IOException { diff --git a/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java b/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java index 8a1ea792f5..36c08b2ed9 100644 --- a/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java +++ b/src/com/vaadin/terminal/gwt/server/WebApplicationContext.java @@ -111,6 +111,7 @@ public class WebApplicationContext extends AbstractWebApplicationContext { * * @see com.vaadin.service.ApplicationContext#getBaseDirectory() */ + @Override public File getBaseDirectory() { final String realPath = ApplicationServlet.getResourcePath( session.getServletContext(), "/"); diff --git a/src/com/vaadin/terminal/gwt/server/WebBrowser.java b/src/com/vaadin/terminal/gwt/server/WebBrowser.java index 38b5409594..14b2ab1d89 100644 --- a/src/com/vaadin/terminal/gwt/server/WebBrowser.java +++ b/src/com/vaadin/terminal/gwt/server/WebBrowser.java @@ -42,6 +42,7 @@ public class WebBrowser implements Terminal { * @return Always returns null. */ + @Override public String getDefaultTheme() { return null; } @@ -52,6 +53,7 @@ public class WebBrowser implements Terminal { * @see com.vaadin.terminal.Terminal#getScreenHeight() */ + @Override public int getScreenHeight() { return screenHeight; } @@ -62,6 +64,7 @@ public class WebBrowser implements Terminal { * @see com.vaadin.terminal.Terminal#getScreenWidth() */ + @Override public int getScreenWidth() { return screenWidth; } diff --git a/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java b/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java index 0774a79990..cf58f398af 100644 --- a/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java +++ b/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java @@ -41,18 +41,22 @@ public class WrappedHttpServletRequest extends HttpServletRequestWrapper this.deploymentConfiguration = deploymentConfiguration; } + @Override public String getRequestPathInfo() { return getPathInfo(); } + @Override public int getSessionMaxInactiveInterval() { return getSession().getMaxInactiveInterval(); } + @Override public Object getSessionAttribute(String name) { return getSession().getAttribute(name); } + @Override public void setSessionAttribute(String name, Object attribute) { getSession().setAttribute(name, attribute); } @@ -66,20 +70,25 @@ public class WrappedHttpServletRequest extends HttpServletRequestWrapper return this; } + @Override public DeploymentConfiguration getDeploymentConfiguration() { return deploymentConfiguration; } + @Override public BrowserDetails getBrowserDetails() { return new BrowserDetails() { + @Override public String getUriFragment() { return null; } + @Override public String getWindowName() { return null; } + @Override public WebBrowser getWebBrowser() { WebApplicationContext context = (WebApplicationContext) Application .getCurrent().getContext(); diff --git a/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java b/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java index 14a391b21f..32b2f352a8 100644 --- a/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java +++ b/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java @@ -47,6 +47,7 @@ public class WrappedHttpServletResponse extends HttpServletResponseWrapper return this; } + @Override public void setCacheTime(long milliseconds) { doSetCacheTime(this, milliseconds); } @@ -67,6 +68,7 @@ public class WrappedHttpServletResponse extends HttpServletResponseWrapper } } + @Override public DeploymentConfiguration getDeploymentConfiguration() { return deploymentConfiguration; } diff --git a/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java b/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java index 85d8d5c69c..44858b3e10 100644 --- a/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java +++ b/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java @@ -46,10 +46,12 @@ public class WrappedPortletRequest implements WrappedRequest { this.deploymentConfiguration = deploymentConfiguration; } + @Override public Object getAttribute(String name) { return request.getAttribute(name); } + @Override public int getContentLength() { try { return ((ClientDataRequest) request).getContentLength(); @@ -59,6 +61,7 @@ public class WrappedPortletRequest implements WrappedRequest { } } + @Override public InputStream getInputStream() throws IOException { try { return ((ClientDataRequest) request).getPortletInputStream(); @@ -68,18 +71,22 @@ public class WrappedPortletRequest implements WrappedRequest { } } + @Override public String getParameter(String name) { return request.getParameter(name); } + @Override public Map getParameterMap() { return request.getParameterMap(); } + @Override public void setAttribute(String name, Object o) { request.setAttribute(name, o); } + @Override public String getRequestPathInfo() { if (request instanceof ResourceRequest) { return ((ResourceRequest) request).getResourceID(); @@ -88,14 +95,17 @@ public class WrappedPortletRequest implements WrappedRequest { } } + @Override public int getSessionMaxInactiveInterval() { return request.getPortletSession().getMaxInactiveInterval(); } + @Override public Object getSessionAttribute(String name) { return request.getPortletSession().getAttribute(name); } + @Override public void setSessionAttribute(String name, Object attribute) { request.getPortletSession().setAttribute(name, attribute); } @@ -109,6 +119,7 @@ public class WrappedPortletRequest implements WrappedRequest { return request; } + @Override public String getContentType() { try { return ((ResourceRequest) request).getContentType(); @@ -118,16 +129,20 @@ public class WrappedPortletRequest implements WrappedRequest { } } + @Override public BrowserDetails getBrowserDetails() { return new BrowserDetails() { + @Override public String getUriFragment() { return null; } + @Override public String getWindowName() { return null; } + @Override public WebBrowser getWebBrowser() { PortletApplicationContext2 context = (PortletApplicationContext2) Application .getCurrent().getContext(); @@ -136,18 +151,22 @@ public class WrappedPortletRequest implements WrappedRequest { }; } + @Override public Locale getLocale() { return request.getLocale(); } + @Override public String getRemoteAddr() { return null; } + @Override public boolean isSecure() { return request.isSecure(); } + @Override public String getHeader(String string) { return null; } @@ -164,6 +183,7 @@ public class WrappedPortletRequest implements WrappedRequest { return request.getPortalContext().getProperty(name); } + @Override public DeploymentConfiguration getDeploymentConfiguration() { return deploymentConfiguration; } diff --git a/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java b/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java index 8824396352..f7ecf26f3c 100644 --- a/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java +++ b/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java @@ -53,6 +53,7 @@ public class WrappedPortletResponse implements WrappedResponse { this.deploymentConfiguration = deploymentConfiguration; } + @Override public OutputStream getOutputStream() throws IOException { return ((MimeResponse) response).getPortletOutputStream(); } @@ -66,36 +67,44 @@ public class WrappedPortletResponse implements WrappedResponse { return response; } + @Override public void setContentType(String type) { ((MimeResponse) response).setContentType(type); } + @Override public PrintWriter getWriter() throws IOException { return ((MimeResponse) response).getWriter(); } + @Override public void setStatus(int responseStatus) { response.setProperty(ResourceResponse.HTTP_STATUS_CODE, Integer.toString(responseStatus)); } + @Override public void setHeader(String name, String value) { response.setProperty(name, value); } + @Override public void setDateHeader(String name, long timestamp) { response.setProperty(name, HTTP_DATE_FORMAT.format(new Date(timestamp))); } + @Override public void setCacheTime(long milliseconds) { WrappedHttpServletResponse.doSetCacheTime(this, milliseconds); } + @Override public void sendError(int errorCode, String message) throws IOException { setStatus(errorCode); getWriter().write(message); } + @Override public DeploymentConfiguration getDeploymentConfiguration() { return deploymentConfiguration; } diff --git a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java index 1c5b736492..6ee30183c1 100644 --- a/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java +++ b/src/com/vaadin/terminal/gwt/widgetsetutils/ClassPathExplorer.java @@ -49,6 +49,7 @@ public class ClassPathExplorer { * File filter that only accepts directories. */ private final static FileFilter DIRECTORIES_ONLY = new FileFilter() { + @Override public boolean accept(File f) { if (f.exists() && f.isDirectory()) { return true; diff --git a/src/com/vaadin/tools/WidgetsetCompiler.java b/src/com/vaadin/tools/WidgetsetCompiler.java index 987fd8f734..ecc1946e60 100644 --- a/src/com/vaadin/tools/WidgetsetCompiler.java +++ b/src/com/vaadin/tools/WidgetsetCompiler.java @@ -51,6 +51,7 @@ public class WidgetsetCompiler { // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6316197) Runnable runCompiler = new Runnable() { + @Override public void run() { try { // GWTCompiler.main(args); diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java index 7d8c402fc9..3fe5eb055a 100644 --- a/src/com/vaadin/ui/AbsoluteLayout.java +++ b/src/com/vaadin/ui/AbsoluteLayout.java @@ -30,6 +30,7 @@ public class AbsoluteLayout extends AbstractLayout implements private AbsoluteLayoutServerRpc rpc = new AbsoluteLayoutServerRpc() { + @Override public void layoutClick(MouseEventDetails mouseDetails, Connector clickedConnector) { fireEvent(LayoutClickEvent.createEvent(AbsoluteLayout.this, @@ -56,6 +57,7 @@ public class AbsoluteLayout extends AbstractLayout implements * Gets an iterator for going through all components enclosed in the * absolute layout. */ + @Override public Iterator getComponentIterator() { return componentToCoordinates.keySet().iterator(); } @@ -66,6 +68,7 @@ public class AbsoluteLayout extends AbstractLayout implements * * @return the number of contained components */ + @Override public int getComponentCount() { return componentToCoordinates.size(); } @@ -74,6 +77,7 @@ public class AbsoluteLayout extends AbstractLayout implements * Replaces one component with another one. The new component inherits the * old components position. */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { ComponentPosition position = getPosition(oldComponent); removeComponent(oldComponent); @@ -612,12 +616,14 @@ public class AbsoluteLayout extends AbstractLayout implements } + @Override public void addListener(LayoutClickListener listener) { addListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener, LayoutClickListener.clickMethod); } + @Override public void removeListener(LayoutClickListener listener) { removeListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener); diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index ba0e5db89c..ead7dee91c 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -101,10 +101,12 @@ public abstract class AbstractComponent extends AbstractClientConnector /* Get/Set component properties */ + @Override public void setDebugId(String id) { getState().setDebugId(id); } + @Override public String getDebugId() { return getState().getDebugId(); } @@ -141,6 +143,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Gets the component's style. Don't add a JavaDoc comment here, we use the * default documentation from implemented interface. */ + @Override public String getStyleName() { String s = ""; if (getState().getStyles() != null) { @@ -159,6 +162,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Sets the component's style. Don't add a JavaDoc comment here, we use the * default documentation from implemented interface. */ + @Override public void setStyleName(String style) { if (style == null || "".equals(style)) { getState().setStyles(null); @@ -179,6 +183,7 @@ public abstract class AbstractComponent extends AbstractClientConnector requestRepaint(); } + @Override public void addStyleName(String style) { if (style == null || "".equals(style)) { return; @@ -201,6 +206,7 @@ public abstract class AbstractComponent extends AbstractClientConnector } } + @Override public void removeStyleName(String style) { if (getState().getStyles() != null) { String[] styleParts = style.split(" +"); @@ -217,6 +223,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Get's the component's caption. Don't add a JavaDoc comment here, we use * the default documentation from implemented interface. */ + @Override public String getCaption() { return getState().getCaption(); } @@ -229,6 +236,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * @param caption * the new caption String for the component. */ + @Override public void setCaption(String caption) { getState().setCaption(caption); requestRepaint(); @@ -238,6 +246,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Don't add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public Locale getLocale() { if (locale != null) { return locale; @@ -283,6 +292,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Gets the component's icon resource. Don't add a JavaDoc comment here, we * use the default documentation from implemented interface. */ + @Override public Resource getIcon() { ResourceReference ref = ((ResourceReference) getState().getIcon()); if (ref == null) { @@ -299,6 +309,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * @param icon * the icon to be shown with the component's caption. */ + @Override public void setIcon(Resource icon) { if (icon == null) { getState().setIcon(null); @@ -313,6 +324,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.ui.Component#isEnabled() */ + @Override public boolean isEnabled() { return getState().isEnabled(); } @@ -322,6 +334,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.ui.Component#setEnabled(boolean) */ + @Override public void setEnabled(boolean enabled) { if (getState().isEnabled() != enabled) { getState().setEnabled(enabled); @@ -377,6 +390,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.ui.Component#isVisible() */ + @Override public boolean isVisible() { return getState().isVisible(); } @@ -386,6 +400,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.ui.Component#setVisible(boolean) */ + @Override public void setVisible(boolean visible) { if (getState().isVisible() == visible) { return; @@ -566,6 +581,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Tests if the component is in read-only mode. Don't add a JavaDoc comment * here, we use the default documentation from implemented interface. */ + @Override public boolean isReadOnly() { return getState().isReadOnly(); } @@ -574,6 +590,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Sets the component's read-only mode. Don't add a JavaDoc comment here, we * use the default documentation from implemented interface. */ + @Override public void setReadOnly(boolean readOnly) { getState().setReadOnly(readOnly); requestRepaint(); @@ -704,6 +721,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.ui.Component#updateState() */ + @Override public void updateState() { // TODO This logic should be on the client side and the state should // simply be a data object with "width" and "height". @@ -863,6 +881,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * @param method * the activation method. */ + @Override public void addListener(Class eventType, Object target, Method method) { if (eventRouter == null) { eventRouter = new EventRouter(); @@ -904,6 +923,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * @param methodName * the name of the activation method. */ + @Override public void addListener(Class eventType, Object target, String methodName) { if (eventRouter == null) { eventRouter = new EventRouter(); @@ -929,6 +949,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * the target object that has registered to listen to events of * type eventType with one or more methods. */ + @Override public void removeListener(Class eventType, Object target) { if (eventRouter != null) { eventRouter.removeListener(eventType, target); @@ -954,6 +975,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * the method owned by target that's registered to * listen to events of type eventType. */ + @Override public void removeListener(Class eventType, Object target, Method method) { if (eventRouter != null) { eventRouter.removeListener(eventType, target, method); @@ -988,6 +1010,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * the name of the method owned by target that's * registered to listen to events of type eventType. */ + @Override public void removeListener(Class eventType, Object target, String methodName) { if (eventRouter != null) { @@ -1032,6 +1055,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * Don't add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public void addListener(Component.Listener listener) { addListener(Component.Event.class, listener, COMPONENT_EVENT_METHOD); } @@ -1041,6 +1065,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * JavaDoc comment here, we use the default documentation from implemented * interface. */ + @Override public void removeListener(Component.Listener listener) { removeListener(Component.Event.class, listener, COMPONENT_EVENT_METHOD); } @@ -1090,6 +1115,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#getHeight() */ + @Override public float getHeight() { return height; } @@ -1099,6 +1125,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#getHeightUnits() */ + @Override public Unit getHeightUnits() { return heightUnit; } @@ -1108,6 +1135,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#getWidth() */ + @Override public float getWidth() { return width; } @@ -1117,6 +1145,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#getWidthUnits() */ + @Override public Unit getWidthUnits() { return widthUnit; } @@ -1126,6 +1155,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#setHeight(float, Unit) */ + @Override public void setHeight(float height, Unit unit) { if (unit == null) { throw new IllegalArgumentException("Unit can not be null"); @@ -1141,6 +1171,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#setSizeFull() */ + @Override public void setSizeFull() { setWidth(100, Unit.PERCENTAGE); setHeight(100, Unit.PERCENTAGE); @@ -1151,6 +1182,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#setSizeUndefined() */ + @Override public void setSizeUndefined() { setWidth(-1, Unit.PIXELS); setHeight(-1, Unit.PIXELS); @@ -1161,6 +1193,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#setWidth(float, Unit) */ + @Override public void setWidth(float width, Unit unit) { if (unit == null) { throw new IllegalArgumentException("Unit can not be null"); @@ -1176,6 +1209,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#setWidth(java.lang.String) */ + @Override public void setWidth(String width) { Size size = parseStringSize(width); if (size != null) { @@ -1190,6 +1224,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * * @see com.vaadin.terminal.Sizeable#setHeight(java.lang.String) */ + @Override public void setHeight(String height) { Size size = parseStringSize(height); if (size != null) { diff --git a/src/com/vaadin/ui/AbstractComponentContainer.java b/src/com/vaadin/ui/AbstractComponentContainer.java index 8ef458b704..bc27242bb8 100644 --- a/src/com/vaadin/ui/AbstractComponentContainer.java +++ b/src/com/vaadin/ui/AbstractComponentContainer.java @@ -38,6 +38,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * Removes all components from the container. This should probably be * re-implemented in extending classes for a more powerful implementation. */ + @Override public void removeAllComponents() { final LinkedList l = new LinkedList(); @@ -57,6 +58,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * add a JavaDoc comment here, we use the default documentation from * implemented interface. */ + @Override public void moveComponentsFrom(ComponentContainer source) { final LinkedList components = new LinkedList(); for (final Iterator i = source.getComponentIterator(); i @@ -93,24 +95,28 @@ public abstract class AbstractComponentContainer extends AbstractComponent } /* documented in interface */ + @Override public void addListener(ComponentAttachListener listener) { addListener(ComponentContainer.ComponentAttachEvent.class, listener, COMPONENT_ATTACHED_METHOD); } /* documented in interface */ + @Override public void addListener(ComponentDetachListener listener) { addListener(ComponentContainer.ComponentDetachEvent.class, listener, COMPONENT_DETACHED_METHOD); } /* documented in interface */ + @Override public void removeListener(ComponentAttachListener listener) { removeListener(ComponentContainer.ComponentAttachEvent.class, listener, COMPONENT_ATTACHED_METHOD); } /* documented in interface */ + @Override public void removeListener(ComponentDetachListener listener) { removeListener(ComponentContainer.ComponentDetachEvent.class, listener, COMPONENT_DETACHED_METHOD); @@ -147,6 +153,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * * @see com.vaadin.ui.ComponentContainer#addComponent(Component) */ + @Override public void addComponent(Component c) { if (c instanceof ComponentContainer) { // Make sure we're not adding the component inside it's own content @@ -177,6 +184,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * * @see com.vaadin.ui.ComponentContainer#removeComponent(Component) */ + @Override public void removeComponent(Component c) { if (c.getParent() == this) { c.setParent(null); @@ -325,6 +333,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent true); } + @Override public Iterator iterator() { return getComponentIterator(); } @@ -335,6 +344,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * @see * com.vaadin.ui.HasComponents#isComponentVisible(com.vaadin.ui.Component) */ + @Override public boolean isComponentVisible(Component childComponent) { return true; } diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index ce62fb43ed..c9181ba3f1 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -178,6 +178,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @return the type of the Field */ + @Override public abstract Class getType(); /** @@ -206,6 +207,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @see com.vaadin.data.BufferedValidatable#isInvalidCommitted() */ + @Override public boolean isInvalidCommitted() { return invalidCommitted; } @@ -215,6 +217,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @see com.vaadin.data.BufferedValidatable#setInvalidCommitted(boolean) */ + @Override public void setInvalidCommitted(boolean isCommitted) { invalidCommitted = isCommitted; } @@ -223,6 +226,7 @@ public abstract class AbstractField extends AbstractComponent implements * Saves the current value to the data source Don't add a JavaDoc comment * here, we use the default documentation from the implemented interface. */ + @Override public void commit() throws Buffered.SourceException, InvalidValueException { if (dataSource != null && !dataSource.isReadOnly()) { if ((isInvalidCommitted() || isValid())) { @@ -271,6 +275,7 @@ public abstract class AbstractField extends AbstractComponent implements * Updates the value from the data source. Don't add a JavaDoc comment here, * we use the default documentation from the implemented interface. */ + @Override public void discard() throws Buffered.SourceException { if (dataSource != null) { @@ -343,6 +348,7 @@ public abstract class AbstractField extends AbstractComponent implements * comment here, we use the default documentation from the implemented * interface. */ + @Override public boolean isModified() { return getState().isModified(); } @@ -356,6 +362,7 @@ public abstract class AbstractField extends AbstractComponent implements * Tests if the field is in write-through mode. Don't add a JavaDoc comment * here, we use the default documentation from the implemented interface. */ + @Override public boolean isWriteThrough() { return writeThroughMode; } @@ -381,6 +388,7 @@ public abstract class AbstractField extends AbstractComponent implements * setReadThrough(true), setWriteThrough(true) equals * setBuffered(false) */ + @Override @Deprecated public void setWriteThrough(boolean writeThrough) throws Buffered.SourceException, InvalidValueException { @@ -397,6 +405,7 @@ public abstract class AbstractField extends AbstractComponent implements * Tests if the field is in read-through mode. Don't add a JavaDoc comment * here, we use the default documentation from the implemented interface. */ + @Override public boolean isReadThrough() { return readThroughMode; } @@ -420,6 +429,7 @@ public abstract class AbstractField extends AbstractComponent implements * setReadThrough(true), setWriteThrough(true) equals * setBuffered(false) */ + @Override @Deprecated public void setReadThrough(boolean readThrough) throws Buffered.SourceException { @@ -452,6 +462,7 @@ public abstract class AbstractField extends AbstractComponent implements * @param buffered * true if buffered mode should be turned on, false otherwise */ + @Override public void setBuffered(boolean buffered) { setReadThrough(!buffered); setWriteThrough(!buffered); @@ -464,6 +475,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @return true if buffered mode is on, false otherwise */ + @Override public boolean isBuffered() { return !isReadThrough() && !isWriteThrough(); } @@ -517,6 +529,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @return the current value of the field. */ + @Override public T getValue() { return getFieldValue(); } @@ -528,6 +541,7 @@ public abstract class AbstractField extends AbstractComponent implements * the New value of the field. * @throws Property.ReadOnlyException */ + @Override public void setValue(Object newFieldValue) throws Property.ReadOnlyException, Converter.ConversionException { // This check is needed as long as setValue accepts Object instead of T @@ -644,6 +658,7 @@ public abstract class AbstractField extends AbstractComponent implements * @return the current data source as a Property, or null if * none defined. */ + @Override public Property getPropertyDataSource() { return dataSource; } @@ -686,6 +701,7 @@ public abstract class AbstractField extends AbstractComponent implements * @param newDataSource * the new data source Property. */ + @Override public void setPropertyDataSource(Property newDataSource) { // Saves the old value @@ -863,6 +879,7 @@ public abstract class AbstractField extends AbstractComponent implements * @param validator * the new validator to be added. */ + @Override public void addValidator(Validator validator) { if (validators == null) { validators = new LinkedList(); @@ -877,6 +894,7 @@ public abstract class AbstractField extends AbstractComponent implements * @return the Unmodifiable collection that holds all validators for the * field. */ + @Override public Collection getValidators() { if (validators == null || validators.isEmpty()) { return null; @@ -890,6 +908,7 @@ public abstract class AbstractField extends AbstractComponent implements * @param validator * the validator to remove. */ + @Override public void removeValidator(Validator validator) { if (validators != null) { validators.remove(validator); @@ -919,6 +938,7 @@ public abstract class AbstractField extends AbstractComponent implements * current value is valid or if the field is empty and not required, * false otherwise. */ + @Override public boolean isValid() { try { @@ -943,6 +963,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @see com.vaadin.data.Validatable#validate() */ + @Override public void validate() throws Validator.InvalidValueException { if (isRequired() && isEmpty()) { @@ -1014,6 +1035,7 @@ public abstract class AbstractField extends AbstractComponent implements * @return true iff the invalid values are allowed. * @see com.vaadin.data.Validatable#isInvalidAllowed() */ + @Override public boolean isInvalidAllowed() { return invalidAllowed; } @@ -1031,6 +1053,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @see com.vaadin.data.Validatable#setInvalidAllowed(boolean) */ + @Override public void setInvalidAllowed(boolean invalidAllowed) throws UnsupportedOperationException { this.invalidAllowed = invalidAllowed; @@ -1103,6 +1126,7 @@ public abstract class AbstractField extends AbstractComponent implements * Adds a value change listener for the field. Don't add a JavaDoc comment * here, we use the default documentation from the implemented interface. */ + @Override public void addListener(Property.ValueChangeListener listener) { addListener(AbstractField.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); @@ -1113,6 +1137,7 @@ public abstract class AbstractField extends AbstractComponent implements * comment here, we use the default documentation from the implemented * interface. */ + @Override public void removeListener(Property.ValueChangeListener listener) { removeListener(AbstractField.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); @@ -1152,6 +1177,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @see Property.ReadOnlyStatusChangeListener */ + @Override public void readOnlyStatusChange(Property.ReadOnlyStatusChangeEvent event) { getState().setPropertyReadOnly(event.getProperty().isReadOnly()); requestRepaint(); @@ -1184,6 +1210,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @return the Source of the event. */ + @Override public Property getProperty() { return (Property) getSource(); } @@ -1194,6 +1221,7 @@ public abstract class AbstractField extends AbstractComponent implements * JavaDoc comment here, we use the default documentation from the * implemented interface. */ + @Override public void addListener(Property.ReadOnlyStatusChangeListener listener) { addListener(Property.ReadOnlyStatusChangeEvent.class, listener, READ_ONLY_STATUS_CHANGE_METHOD); @@ -1204,6 +1232,7 @@ public abstract class AbstractField extends AbstractComponent implements * JavaDoc comment here, we use the default documentation from the * implemented interface. */ + @Override public void removeListener(Property.ReadOnlyStatusChangeListener listener) { removeListener(Property.ReadOnlyStatusChangeEvent.class, listener, READ_ONLY_STATUS_CHANGE_METHOD); @@ -1228,6 +1257,7 @@ public abstract class AbstractField extends AbstractComponent implements * the value change event telling the data source contents have * changed. */ + @Override public void valueChange(Property.ValueChangeEvent event) { if (isReadThrough()) { if (committingValueToDataSource) { @@ -1271,6 +1301,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @see com.vaadin.ui.Component.Focusable#getTabIndex() */ + @Override public int getTabIndex() { return getState().getTabIndex(); } @@ -1280,6 +1311,7 @@ public abstract class AbstractField extends AbstractComponent implements * * @see com.vaadin.ui.Component.Focusable#setTabIndex(int) */ + @Override public void setTabIndex(int tabIndex) { getState().setTabIndex(tabIndex); requestRepaint(); @@ -1362,6 +1394,7 @@ public abstract class AbstractField extends AbstractComponent implements * @return true if the field is required, otherwise * false. */ + @Override public boolean isRequired() { return getState().isRequired(); } @@ -1381,6 +1414,7 @@ public abstract class AbstractField extends AbstractComponent implements * @param required * Is the field required. */ + @Override public void setRequired(boolean required) { getState().setRequired(required); requestRepaint(); @@ -1395,11 +1429,13 @@ public abstract class AbstractField extends AbstractComponent implements * @param requiredMessage * Message to be shown when this field is required, but empty. */ + @Override public void setRequiredError(String requiredMessage) { requiredError = requiredMessage; requestRepaint(); } + @Override public String getRequiredError() { return requiredError; } diff --git a/src/com/vaadin/ui/AbstractLayout.java b/src/com/vaadin/ui/AbstractLayout.java index 4876b40265..d31c855659 100644 --- a/src/com/vaadin/ui/AbstractLayout.java +++ b/src/com/vaadin/ui/AbstractLayout.java @@ -32,6 +32,7 @@ public abstract class AbstractLayout extends AbstractComponentContainer * * @see com.vaadin.ui.Layout#setMargin(boolean) */ + @Override public void setMargin(boolean enabled) { margins.setMargins(enabled); getState().setMarginsBitmask(margins.getBitMask()); @@ -43,6 +44,7 @@ public abstract class AbstractLayout extends AbstractComponentContainer * * @see com.vaadin.ui.Layout.MarginHandler#getMargin() */ + @Override public MarginInfo getMargin() { return margins; } @@ -52,6 +54,7 @@ public abstract class AbstractLayout extends AbstractComponentContainer * * @see com.vaadin.ui.Layout.MarginHandler#setMargin(MarginInfo) */ + @Override public void setMargin(MarginInfo marginInfo) { margins.setMargins(marginInfo); getState().setMarginsBitmask(margins.getBitMask()); @@ -63,6 +66,7 @@ public abstract class AbstractLayout extends AbstractComponentContainer * * @see com.vaadin.ui.Layout#setMargin(boolean, boolean, boolean, boolean) */ + @Override public void setMargin(boolean topEnabled, boolean rightEnabled, boolean bottomEnabled, boolean leftEnabled) { margins.setMargins(topEnabled, rightEnabled, bottomEnabled, leftEnabled); diff --git a/src/com/vaadin/ui/AbstractOrderedLayout.java b/src/com/vaadin/ui/AbstractOrderedLayout.java index 2cd6fc2a9a..7230e6534b 100644 --- a/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -24,6 +24,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements private AbstractOrderedLayoutServerRpc rpc = new AbstractOrderedLayoutServerRpc() { + @Override public void layoutClick(MouseEventDetails mouseDetails, Connector clickedConnector) { fireEvent(LayoutClickEvent.createEvent(AbstractOrderedLayout.this, @@ -157,6 +158,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * * @return the Iterator of the components inside the container. */ + @Override public Iterator getComponentIterator() { return components.iterator(); } @@ -167,11 +169,13 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * * @return the number of contained components */ + @Override public int getComponentCount() { return components.size(); } /* Documented in superclass */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { // Gets the locations @@ -220,12 +224,14 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * @see com.vaadin.ui.Layout.AlignmentHandler#setComponentAlignment(com * .vaadin.ui.Component, int, int) */ + @Override public void setComponentAlignment(Component childComponent, int horizontalAlignment, int verticalAlignment) { Alignment a = new Alignment(horizontalAlignment + verticalAlignment); setComponentAlignment(childComponent, a); } + @Override public void setComponentAlignment(Component childComponent, Alignment alignment) { ChildComponentData childData = getState().getChildData().get( @@ -247,6 +253,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * @see com.vaadin.ui.Layout.AlignmentHandler#getComponentAlignment(com * .vaadin.ui.Component) */ + @Override public Alignment getComponentAlignment(Component childComponent) { ChildComponentData childData = getState().getChildData().get( childComponent); @@ -263,6 +270,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * * @see com.vaadin.ui.Layout.SpacingHandler#setSpacing(boolean) */ + @Override public void setSpacing(boolean spacing) { getState().setSpacing(spacing); requestRepaint(); @@ -273,6 +281,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * * @see com.vaadin.ui.Layout.SpacingHandler#isSpacing() */ + @Override public boolean isSpacing() { return getState().isSpacing(); } @@ -334,12 +343,14 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements return childData.getExpandRatio(); } + @Override public void addListener(LayoutClickListener listener) { addListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener, LayoutClickListener.clickMethod); } + @Override public void removeListener(LayoutClickListener listener) { removeListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener); diff --git a/src/com/vaadin/ui/AbstractSelect.java b/src/com/vaadin/ui/AbstractSelect.java index 6a927251af..399e08800e 100644 --- a/src/com/vaadin/ui/AbstractSelect.java +++ b/src/com/vaadin/ui/AbstractSelect.java @@ -320,6 +320,7 @@ public abstract class AbstractSelect extends AbstractField implements * @throws PaintException * if the paint operation failed. */ + @Override public void paintContent(PaintTarget target) throws PaintException { // Paints select attributes @@ -422,6 +423,7 @@ public abstract class AbstractSelect extends AbstractField implements * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object, * java.util.Map) */ + @Override public void changeVariables(Object source, Map variables) { // New option entered (and it is allowed) @@ -542,6 +544,7 @@ public abstract class AbstractSelect extends AbstractField implements * */ public class DefaultNewItemHandler implements NewItemHandler { + @Override public void addNewItem(String newItemCaption) { // Checks for readonly if (isReadOnly()) { @@ -692,6 +695,7 @@ public abstract class AbstractSelect extends AbstractField implements * the item id. * @return the item from the container. */ + @Override public Item getItem(Object itemId) { return items.getItem(itemId); } @@ -701,6 +705,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @return the Collection of item ids. */ + @Override public Collection getItemIds() { return items.getItemIds(); } @@ -710,6 +715,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @return the Collection of property ids. */ + @Override public Collection getContainerPropertyIds() { return items.getContainerPropertyIds(); } @@ -721,6 +727,7 @@ public abstract class AbstractSelect extends AbstractField implements * the Id identifying the property. * @see com.vaadin.data.Container#getType(java.lang.Object) */ + @Override public Class getType(Object propertyId) { return items.getType(propertyId); } @@ -732,6 +739,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container#size() */ + @Override public int size() { return items.size(); } @@ -742,6 +750,7 @@ public abstract class AbstractSelect extends AbstractField implements * @param itemId * the Id the of item to be tested. */ + @Override public boolean containsId(Object itemId) { if (itemId != null) { return items.containsId(itemId); @@ -756,6 +765,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container#getContainerProperty(Object, Object) */ + @Override public Property getContainerProperty(Object itemId, Object propertyId) { return items.getContainerProperty(itemId, propertyId); } @@ -771,6 +781,7 @@ public abstract class AbstractSelect extends AbstractField implements * @see com.vaadin.data.Container#addContainerProperty(java.lang.Object, * java.lang.Class, java.lang.Object) */ + @Override public boolean addContainerProperty(Object propertyId, Class type, Object defaultValue) throws UnsupportedOperationException { @@ -791,6 +802,7 @@ public abstract class AbstractSelect extends AbstractField implements * @return True if the operation succeeded. * @see com.vaadin.data.Container#removeAllItems() */ + @Override public boolean removeAllItems() throws UnsupportedOperationException { final boolean retval = items.removeAllItems(); @@ -812,6 +824,7 @@ public abstract class AbstractSelect extends AbstractField implements * @return the Id of the created item or null in case of failure. * @see com.vaadin.data.Container#addItem() */ + @Override public Object addItem() throws UnsupportedOperationException { final Object retval = items.addItem(); @@ -836,6 +849,7 @@ public abstract class AbstractSelect extends AbstractField implements * @return the Created item with the given id, or null in case of failure. * @see com.vaadin.data.Container#addItem(java.lang.Object) */ + @Override public Item addItem(Object itemId) throws UnsupportedOperationException { final Item retval = items.addItem(itemId); @@ -851,6 +865,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container#removeItem(java.lang.Object) */ + @Override public boolean removeItem(Object itemId) throws UnsupportedOperationException { @@ -873,6 +888,7 @@ public abstract class AbstractSelect extends AbstractField implements * @return True if the operation succeeded. * @see com.vaadin.data.Container#removeContainerProperty(java.lang.Object) */ + @Override public boolean removeContainerProperty(Object propertyId) throws UnsupportedOperationException { @@ -896,6 +912,7 @@ public abstract class AbstractSelect extends AbstractField implements * @param newDataSource * the new data source. */ + @Override public void setContainerDataSource(Container newDataSource) { if (newDataSource == null) { newDataSource = new IndexedContainer(); @@ -950,6 +967,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.Viewer#getContainerDataSource() */ + @Override public Container getContainerDataSource() { return items; } @@ -1432,6 +1450,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.PropertySetChangeListener#containerPropertySetChange(com.vaadin.data.Container.PropertySetChangeEvent) */ + @Override public void containerPropertySetChange( Container.PropertySetChangeEvent event) { firePropertySetChange(); @@ -1442,6 +1461,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.PropertySetChangeNotifier#addListener(com.vaadin.data.Container.PropertySetChangeListener) */ + @Override public void addListener(Container.PropertySetChangeListener listener) { if (propertySetEventListeners == null) { propertySetEventListeners = new LinkedHashSet(); @@ -1454,6 +1474,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.PropertySetChangeNotifier#removeListener(com.vaadin.data.Container.PropertySetChangeListener) */ + @Override public void removeListener(Container.PropertySetChangeListener listener) { if (propertySetEventListeners != null) { propertySetEventListeners.remove(listener); @@ -1468,6 +1489,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.ItemSetChangeNotifier#addListener(com.vaadin.data.Container.ItemSetChangeListener) */ + @Override public void addListener(Container.ItemSetChangeListener listener) { if (itemSetEventListeners == null) { itemSetEventListeners = new LinkedHashSet(); @@ -1480,6 +1502,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.ItemSetChangeNotifier#removeListener(com.vaadin.data.Container.ItemSetChangeListener) */ + @Override public void removeListener(Container.ItemSetChangeListener listener) { if (itemSetEventListeners != null) { itemSetEventListeners.remove(listener); @@ -1516,6 +1539,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.ItemSetChangeListener#containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent) */ + @Override public void containerItemSetChange(Container.ItemSetChangeEvent event) { // Clears the item id mapping table itemIdMapper.removeAll(); @@ -1566,6 +1590,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.ItemSetChangeEvent#getContainer() */ + @Override public Container getContainer() { return AbstractSelect.this; } @@ -1583,6 +1608,7 @@ public abstract class AbstractSelect extends AbstractField implements * * @see com.vaadin.data.Container.PropertySetChangeEvent#getContainer() */ + @Override public Container getContainer() { return AbstractSelect.this; } @@ -1778,10 +1804,12 @@ public abstract class AbstractSelect extends AbstractField implements captionChangeNotifiers.clear(); } + @Override public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { requestRepaint(); } + @Override public void itemPropertySetChange( com.vaadin.data.Item.PropertySetChangeEvent event) { requestRepaint(); @@ -1809,6 +1837,7 @@ public abstract class AbstractSelect extends AbstractField implements super(select, itemId); } + @Override public boolean accept(DragAndDropEvent dragEvent) { AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dragEvent .getTargetDetails(); @@ -1875,6 +1904,7 @@ public abstract class AbstractSelect extends AbstractField implements super(select, itemId); } + @Override public boolean accept(DragAndDropEvent dragEvent) { DataBoundTransferable transferable = (DataBoundTransferable) dragEvent .getTransferable(); diff --git a/src/com/vaadin/ui/AbstractSplitPanel.java b/src/com/vaadin/ui/AbstractSplitPanel.java index 876d39f2ae..72d17039ed 100644 --- a/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/src/com/vaadin/ui/AbstractSplitPanel.java @@ -38,11 +38,13 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { private AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() { + @Override public void splitterClick(MouseEventDetails mouseDetails) { fireEvent(new SplitterClickEvent(AbstractSplitPanel.this, mouseDetails)); } + @Override public void setSplitterPosition(float position) { getSplitterState().setPosition(position); } @@ -63,6 +65,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { int i = 0; + @Override public boolean hasNext() { if (i < getComponentCount()) { return true; @@ -70,6 +73,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { return false; } + @Override public Component next() { if (!hasNext()) { return null; @@ -84,6 +88,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { return null; } + @Override public void remove() { if (i == 1) { if (getFirstComponent() != null) { @@ -211,6 +216,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @see com.vaadin.ui.ComponentContainer#getComponentIterator() */ + @Override public Iterator getComponentIterator() { return new ComponentIterator(); } @@ -222,6 +228,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @return the number of contained components (zero, one or two) */ + @Override public int getComponentCount() { int count = 0; if (getFirstComponent() != null) { @@ -235,6 +242,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { /* Documented in superclass */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { if (oldComponent == getFirstComponent()) { setFirstComponent(newComponent); diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index d584374bda..4f1eef9ae5 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -95,6 +95,7 @@ public abstract class AbstractTextField extends AbstractField implements getState().setText(value); } + @Override public void paintContent(PaintTarget target) throws PaintException { if (selectionPosition != -1) { @@ -123,6 +124,7 @@ public abstract class AbstractTextField extends AbstractField implements } + @Override public void changeVariables(Object source, Map variables) { changingVariables = true; @@ -498,11 +500,13 @@ public abstract class AbstractTextField extends AbstractField implements LAZY } + @Override public void addListener(TextChangeListener listener) { addListener(TextChangeListener.EVENT_ID, TextChangeEvent.class, listener, TextChangeListener.EVENT_METHOD); } + @Override public void removeListener(TextChangeListener listener) { removeListener(TextChangeListener.EVENT_ID, TextChangeEvent.class, listener); @@ -645,20 +649,24 @@ public abstract class AbstractTextField extends AbstractField implements return lastKnownCursorPosition; } + @Override public void addListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } + @Override public void removeListener(FocusListener listener) { removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); } + @Override public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } + @Override public void removeListener(BlurListener listener) { removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java index 0abc50f26f..1fe4055a8b 100644 --- a/src/com/vaadin/ui/Button.java +++ b/src/com/vaadin/ui/Button.java @@ -39,10 +39,12 @@ public class Button extends AbstractComponent implements private ButtonServerRpc rpc = new ButtonServerRpc() { + @Override public void click(MouseEventDetails mouseEventDetails) { fireClick(mouseEventDetails); } + @Override public void disableOnClick() { // Could be optimized so the button is not repainted because of // this (client side has already disabled the button) @@ -332,20 +334,24 @@ public class Button extends AbstractComponent implements fireEvent(new Button.ClickEvent(this, details)); } + @Override public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } + @Override public void removeListener(BlurListener listener) { removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } + @Override public void addListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } + @Override public void removeListener(FocusListener listener) { removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); @@ -474,6 +480,7 @@ public class Button extends AbstractComponent implements * * @see com.vaadin.ui.Component.Focusable#getTabIndex() */ + @Override public int getTabIndex() { return getState().getTabIndex(); } @@ -483,6 +490,7 @@ public class Button extends AbstractComponent implements * * @see com.vaadin.ui.Component.Focusable#setTabIndex(int) */ + @Override public void setTabIndex(int tabIndex) { getState().setTabIndex(tabIndex); requestRepaint(); diff --git a/src/com/vaadin/ui/CheckBox.java b/src/com/vaadin/ui/CheckBox.java index 147a270059..39886cd70c 100644 --- a/src/com/vaadin/ui/CheckBox.java +++ b/src/com/vaadin/ui/CheckBox.java @@ -18,6 +18,7 @@ public class CheckBox extends AbstractField { private CheckBoxServerRpc rpc = new CheckBoxServerRpc() { + @Override public void setChecked(boolean checked, MouseEventDetails mouseEventDetails) { if (isReadOnly()) { diff --git a/src/com/vaadin/ui/Component.java b/src/com/vaadin/ui/Component.java index 5d05f9d0f2..d91af1b5ba 100644 --- a/src/com/vaadin/ui/Component.java +++ b/src/com/vaadin/ui/Component.java @@ -305,6 +305,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * * @return the parent component */ + @Override public HasComponents getParent(); /** @@ -507,6 +508,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * @return the Root of the component or null if it is not * attached to a Root */ + @Override public Root getRoot(); /** @@ -585,6 +587,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * } * */ + @Override public void attach(); /** @@ -620,6 +623,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * * @since 7.0 */ + @Override public ComponentState getState(); /** diff --git a/src/com/vaadin/ui/CssLayout.java b/src/com/vaadin/ui/CssLayout.java index e8ec6bd041..eb0b836745 100644 --- a/src/com/vaadin/ui/CssLayout.java +++ b/src/com/vaadin/ui/CssLayout.java @@ -60,6 +60,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { private CssLayoutServerRpc rpc = new CssLayoutServerRpc() { + @Override public void layoutClick(MouseEventDetails mouseDetails, Connector clickedConnector) { fireEvent(LayoutClickEvent.createEvent(CssLayout.this, @@ -167,6 +168,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { * * @return the Iterator of the components inside the container. */ + @Override public Iterator getComponentIterator() { return components.iterator(); } @@ -177,6 +179,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { * * @return the number of contained components */ + @Override public int getComponentCount() { return components.size(); } @@ -223,6 +226,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { } /* Documented in superclass */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { // Gets the locations @@ -264,12 +268,14 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { } } + @Override public void addListener(LayoutClickListener listener) { addListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener, LayoutClickListener.clickMethod); } + @Override public void removeListener(LayoutClickListener listener) { removeListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener); diff --git a/src/com/vaadin/ui/CustomComponent.java b/src/com/vaadin/ui/CustomComponent.java index 98d650f6db..40b5dcd636 100644 --- a/src/com/vaadin/ui/CustomComponent.java +++ b/src/com/vaadin/ui/CustomComponent.java @@ -100,20 +100,24 @@ public class CustomComponent extends AbstractComponentContainer { Serializable { boolean first = getCompositionRoot() != null; + @Override public boolean hasNext() { return first; } + @Override public Component next() { first = false; return root; } + @Override public void remove() { throw new UnsupportedOperationException(); } } + @Override public Iterator getComponentIterator() { return new ComponentIterator(); } @@ -124,6 +128,7 @@ public class CustomComponent extends AbstractComponentContainer { * * @return the number of contained components (zero or one) */ + @Override public int getComponentCount() { return (root != null ? 1 : 0); } @@ -134,6 +139,7 @@ public class CustomComponent extends AbstractComponentContainer { * @see com.vaadin.ui.ComponentContainer#replaceComponent(com.vaadin.ui.Component, * com.vaadin.ui.Component) */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { throw new UnsupportedOperationException(); } diff --git a/src/com/vaadin/ui/CustomField.java b/src/com/vaadin/ui/CustomField.java index 0998c11612..ab3797a58c 100644 --- a/src/com/vaadin/ui/CustomField.java +++ b/src/com/vaadin/ui/CustomField.java @@ -123,28 +123,34 @@ public abstract class CustomField extends AbstractField implements Serializable { boolean first = (root != null); + @Override public boolean hasNext() { return first; } + @Override public Component next() { first = false; return getContent(); } + @Override public void remove() { throw new UnsupportedOperationException(); } } + @Override public Iterator getComponentIterator() { return new ComponentIterator(); } + @Override public Iterator iterator() { return getComponentIterator(); } + @Override public int getComponentCount() { return (null != getContent()) ? 1 : 0; } @@ -163,22 +169,27 @@ public abstract class CustomField extends AbstractField implements // TODO remove these methods when ComponentContainer interface is cleaned up + @Override public void addComponent(Component c) { throw new UnsupportedOperationException(); } + @Override public void removeComponent(Component c) { throw new UnsupportedOperationException(); } + @Override public void removeAllComponents() { throw new UnsupportedOperationException(); } + @Override public void replaceComponent(Component oldComponent, Component newComponent) { throw new UnsupportedOperationException(); } + @Override public void moveComponentsFrom(ComponentContainer source) { throw new UnsupportedOperationException(); } @@ -197,24 +208,29 @@ public abstract class CustomField extends AbstractField implements } } + @Override public void addListener(ComponentAttachListener listener) { addListener(ComponentContainer.ComponentAttachEvent.class, listener, COMPONENT_ATTACHED_METHOD); } + @Override public void removeListener(ComponentAttachListener listener) { removeListener(ComponentContainer.ComponentAttachEvent.class, listener, COMPONENT_ATTACHED_METHOD); } + @Override public void addListener(ComponentDetachListener listener) { // content never detached } + @Override public void removeListener(ComponentDetachListener listener) { // content never detached } + @Override public boolean isComponentVisible(Component childComponent) { return true; } diff --git a/src/com/vaadin/ui/CustomLayout.java b/src/com/vaadin/ui/CustomLayout.java index 97cea1c49d..6c8073ffa1 100644 --- a/src/com/vaadin/ui/CustomLayout.java +++ b/src/com/vaadin/ui/CustomLayout.java @@ -185,6 +185,7 @@ public class CustomLayout extends AbstractLayout implements Vaadin6Component { * * @return the Iterator of the components inside the container. */ + @Override public Iterator getComponentIterator() { return slots.values().iterator(); } @@ -195,6 +196,7 @@ public class CustomLayout extends AbstractLayout implements Vaadin6Component { * * @return the number of contained components */ + @Override public int getComponentCount() { return slots.values().size(); } @@ -212,6 +214,7 @@ public class CustomLayout extends AbstractLayout implements Vaadin6Component { } /* Documented in superclass */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { // Gets the locations @@ -305,10 +308,12 @@ public class CustomLayout extends AbstractLayout implements Vaadin6Component { "CustomLayout does not support margins."); } + @Override public void changeVariables(Object source, Map variables) { // Nothing to see here } + @Override public void paintContent(PaintTarget target) throws PaintException { // Workaround to make the CommunicationManager read the template file // and send it to the client diff --git a/src/com/vaadin/ui/DateField.java b/src/com/vaadin/ui/DateField.java index 55ff67229c..d0a22f3c29 100644 --- a/src/com/vaadin/ui/DateField.java +++ b/src/com/vaadin/ui/DateField.java @@ -286,6 +286,7 @@ public class DateField extends AbstractField implements * Paints this component. Don't add a JavaDoc comment here, we use the * default documentation from implemented interface. */ + @Override public void paintContent(PaintTarget target) throws PaintException { // Adds the locale as attribute @@ -339,6 +340,7 @@ public class DateField extends AbstractField implements * comment here, we use the default documentation from implemented * interface. */ + @Override public void changeVariables(Object source, Map variables) { if (!isReadOnly() @@ -729,20 +731,24 @@ public class DateField extends AbstractField implements return lenient; } + @Override public void addListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } + @Override public void removeListener(FocusListener listener) { removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); } + @Override public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } + @Override public void removeListener(BlurListener listener) { removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } diff --git a/src/com/vaadin/ui/DefaultFieldFactory.java b/src/com/vaadin/ui/DefaultFieldFactory.java index 9d096094e3..e17f08c1c6 100644 --- a/src/com/vaadin/ui/DefaultFieldFactory.java +++ b/src/com/vaadin/ui/DefaultFieldFactory.java @@ -35,6 +35,7 @@ public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory protected DefaultFieldFactory() { } + @Override public Field createField(Item item, Object propertyId, Component uiContext) { Class type = item.getItemProperty(propertyId).getType(); @@ -43,6 +44,7 @@ public class DefaultFieldFactory implements FormFieldFactory, TableFieldFactory return field; } + @Override public Field createField(Container container, Object itemId, Object propertyId, Component uiContext) { Property containerProperty = container.getContainerProperty(itemId, diff --git a/src/com/vaadin/ui/DragAndDropWrapper.java b/src/com/vaadin/ui/DragAndDropWrapper.java index b623197a4c..bfb377b002 100644 --- a/src/com/vaadin/ui/DragAndDropWrapper.java +++ b/src/com/vaadin/ui/DragAndDropWrapper.java @@ -214,10 +214,12 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, requestRepaint(); } + @Override public void changeVariables(Object source, Map variables) { // TODO Remove once Vaadin6Component is no longer implemented } + @Override public void paintContent(PaintTarget target) throws PaintException { target.addAttribute(VDragAndDropWrapper.DRAG_START_MODE, dragStartMode.ordinal()); @@ -249,6 +251,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, private DropHandler dropHandler; + @Override public DropHandler getDropHandler() { return dropHandler; } @@ -258,11 +261,13 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, requestRepaint(); } + @Override public TargetDetails translateDropTargetDetails( Map clientVariables) { return new WrapperTargetDetails(clientVariables); } + @Override public Transferable getTransferable(final Map rawVariables) { return new WrapperTransferable(this, rawVariables); } @@ -286,6 +291,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, private boolean listenProgressOfUploadedFile; + @Override public OutputStream getOutputStream() { if (file.getStreamVariable() == null) { return null; @@ -293,15 +299,18 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, return file.getStreamVariable().getOutputStream(); } + @Override public boolean listenProgress() { return file.getStreamVariable().listenProgress(); } + @Override public void onProgress(StreamingProgressEvent event) { file.getStreamVariable().onProgress( new ReceivingEventWrapper(event)); } + @Override public void streamingStarted(StreamingStartEvent event) { listenProgressOfUploadedFile = file.getStreamVariable() != null; if (listenProgressOfUploadedFile) { @@ -315,6 +324,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, event.disposeStreamVariable(); } + @Override public void streamingFinished(StreamingEndEvent event) { if (listenProgressOfUploadedFile) { file.getStreamVariable().streamingFinished( @@ -322,6 +332,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, } } + @Override public void streamingFailed(final StreamingErrorEvent event) { if (listenProgressOfUploadedFile) { file.getStreamVariable().streamingFailed( @@ -329,6 +340,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, } } + @Override public boolean isInterrupted() { return file.getStreamVariable().isInterrupted(); } @@ -348,14 +360,17 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, wrappedEvent = e; } + @Override public String getMimeType() { return file.getType(); } + @Override public String getFileName() { return file.getFileName(); } + @Override public long getContentLength() { return file.getFileSize(); } @@ -364,6 +379,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, return ProxyReceiver.this; } + @Override public Exception getException() { if (wrappedEvent instanceof StreamingErrorEvent) { return ((StreamingErrorEvent) wrappedEvent).getException(); @@ -371,6 +387,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, return null; } + @Override public long getBytesReceived() { return wrappedEvent.getBytesReceived(); } @@ -379,6 +396,7 @@ public class DragAndDropWrapper extends CustomComponent implements DropTarget, * Calling this method has no effect. DD files are receive only once * anyway. */ + @Override public void disposeStreamVariable() { } diff --git a/src/com/vaadin/ui/Embedded.java b/src/com/vaadin/ui/Embedded.java index 1bcd984666..8a75c0bb12 100644 --- a/src/com/vaadin/ui/Embedded.java +++ b/src/com/vaadin/ui/Embedded.java @@ -81,6 +81,7 @@ public class Embedded extends AbstractComponent implements Vaadin6Component { private String altText; private EmbeddedServerRpc rpc = new EmbeddedServerRpc() { + @Override public void click(MouseEventDetails mouseDetails) { fireEvent(new ClickEvent(Embedded.this, mouseDetails)); } @@ -120,6 +121,7 @@ public class Embedded extends AbstractComponent implements Vaadin6Component { /** * Invoked when the component state should be painted. */ + @Override public void paintContent(PaintTarget target) throws PaintException { switch (type) { @@ -521,6 +523,7 @@ public class Embedded extends AbstractComponent implements Vaadin6Component { ClickEvent.class, listener); } + @Override public void changeVariables(Object source, Map variables) { // TODO Remove once Vaadin6Component is no longer implemented } diff --git a/src/com/vaadin/ui/Field.java b/src/com/vaadin/ui/Field.java index 3a66db47b0..6dc40d192f 100644 --- a/src/com/vaadin/ui/Field.java +++ b/src/com/vaadin/ui/Field.java @@ -89,6 +89,7 @@ public interface Field extends Component, BufferedValidatable, Property, * * @return the Source Property of the event. */ + @Override public Property getProperty() { return (Property) getSource(); } diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java index 796ad17448..4b66346d86 100644 --- a/src/com/vaadin/ui/Form.java +++ b/src/com/vaadin/ui/Form.java @@ -126,6 +126,7 @@ public class Form extends AbstractField implements Item.Editor, * See e.g. DateField#notifyFormOfValidityChange(). */ private final ValueChangeListener fieldValueChangeListener = new ValueChangeListener() { + @Override public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { requestRepaint(); } @@ -194,12 +195,14 @@ public class Form extends AbstractField implements Item.Editor, } /* Documented in interface */ + @Override public void paintContent(PaintTarget target) throws PaintException { if (ownActionManager != null) { ownActionManager.paintActions(null, target); } } + @Override public void changeVariables(Object source, Map variables) { // Actions if (ownActionManager != null) { @@ -467,6 +470,7 @@ public class Form extends AbstractField implements Item.Editor, * * @see com.vaadin.data.Item#addItemProperty(Object, Property) */ + @Override public boolean addItemProperty(Object id, Property property) { // Checks inputs @@ -598,6 +602,7 @@ public class Form extends AbstractField implements Item.Editor, * * @see com.vaadin.data.Item#getItemProperty(Object) */ + @Override public Property getItemProperty(Object id) { final Field field = fields.get(id); if (field == null) { @@ -624,6 +629,7 @@ public class Form extends AbstractField implements Item.Editor, } /* Documented in interface */ + @Override public Collection getItemPropertyIds() { return Collections.unmodifiableCollection(propertyIds); } @@ -633,6 +639,7 @@ public class Form extends AbstractField implements Item.Editor, * * @see com.vaadin.data.Item#removeItemProperty(Object) */ + @Override public boolean removeItemProperty(Object id) { ownProperties.remove(id); @@ -687,6 +694,7 @@ public class Form extends AbstractField implements Item.Editor, } /* Documented in the interface */ + @Override public Item getItemDataSource() { return itemDatasource; } @@ -701,6 +709,7 @@ public class Form extends AbstractField implements Item.Editor, * * @see com.vaadin.data.Item.Viewer#setItemDataSource(Item) */ + @Override public void setItemDataSource(Item newDataSource) { setItemDataSource(newDataSource, newDataSource != null ? newDataSource.getItemPropertyIds() @@ -1301,10 +1310,12 @@ public class Form extends AbstractField implements Item.Editor, return ownActionManager; } + @Override public void addActionHandler(Handler actionHandler) { getOwnActionManager().addActionHandler(actionHandler); } + @Override public void removeActionHandler(Handler actionHandler) { if (ownActionManager != null) { ownActionManager.removeActionHandler(actionHandler); @@ -1320,11 +1331,13 @@ public class Form extends AbstractField implements Item.Editor, } } + @Override public void addAction( T action) { getOwnActionManager().addAction(action); } + @Override public void removeAction( T action) { if (ownActionManager != null) { @@ -1332,6 +1345,7 @@ public class Form extends AbstractField implements Item.Editor, } } + @Override public Iterator iterator() { return getComponentIterator(); } @@ -1345,6 +1359,7 @@ public class Form extends AbstractField implements Item.Editor, int i = 0; + @Override public boolean hasNext() { if (i < getComponentCount()) { return true; @@ -1352,6 +1367,7 @@ public class Form extends AbstractField implements Item.Editor, return false; } + @Override public Component next() { if (!hasNext()) { return null; @@ -1365,6 +1381,7 @@ public class Form extends AbstractField implements Item.Editor, return null; } + @Override public void remove() { if (i == 1) { if (getLayout() != null) { @@ -1379,6 +1396,7 @@ public class Form extends AbstractField implements Item.Editor, } } + @Override public Iterator getComponentIterator() { return new ComponentIterator(); } @@ -1395,6 +1413,7 @@ public class Form extends AbstractField implements Item.Editor, return count; } + @Override public boolean isComponentVisible(Component childComponent) { return true; }; diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java index 0ab729ce5c..0e9336e7ab 100644 --- a/src/com/vaadin/ui/GridLayout.java +++ b/src/com/vaadin/ui/GridLayout.java @@ -58,6 +58,7 @@ public class GridLayout extends AbstractLayout implements private GridLayoutServerRpc rpc = new GridLayoutServerRpc() { + @Override public void layoutClick(MouseEventDetails mouseDetails, Connector clickedConnector) { fireEvent(LayoutClickEvent.createEvent(GridLayout.this, @@ -417,6 +418,7 @@ public class GridLayout extends AbstractLayout implements * * @return the Iterator of the components inside the layout. */ + @Override public Iterator getComponentIterator() { return Collections.unmodifiableCollection(components).iterator(); } @@ -427,10 +429,12 @@ public class GridLayout extends AbstractLayout implements * * @return the number of contained components */ + @Override public int getComponentCount() { return components.size(); } + @Override public void changeVariables(Object source, Map variables) { // TODO Remove once Vaadin6Component is no longer implemented } @@ -443,6 +447,7 @@ public class GridLayout extends AbstractLayout implements * @throws PaintException * if the paint operation failed. */ + @Override public void paintContent(PaintTarget target) throws PaintException { // TODO refactor attribute names in future release. target.addAttribute("structuralChange", structuralChange); @@ -668,6 +673,7 @@ public class GridLayout extends AbstractLayout implements * @see com.vaadin.ui.Layout.AlignmentHandler#getComponentAlignment(com * .vaadin.ui.Component) */ + @Override public Alignment getComponentAlignment(Component childComponent) { Alignment alignment = componentToAlignment.get(childComponent); if (alignment == null) { @@ -1094,6 +1100,7 @@ public class GridLayout extends AbstractLayout implements } /* Documented in superclass */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { // Gets the locations @@ -1143,6 +1150,7 @@ public class GridLayout extends AbstractLayout implements * @see com.vaadin.ui.Layout.AlignmentHandler#setComponentAlignment(com * .vaadin.ui.Component, int, int) */ + @Override public void setComponentAlignment(Component childComponent, int horizontalAlignment, int verticalAlignment) { componentToAlignment.put(childComponent, new Alignment( @@ -1150,6 +1158,7 @@ public class GridLayout extends AbstractLayout implements requestRepaint(); } + @Override public void setComponentAlignment(Component childComponent, Alignment alignment) { componentToAlignment.put(childComponent, alignment); @@ -1161,6 +1170,7 @@ public class GridLayout extends AbstractLayout implements * * @see com.vaadin.ui.Layout.SpacingHandler#setSpacing(boolean) */ + @Override public void setSpacing(boolean spacing) { getState().setSpacing(spacing); requestRepaint(); @@ -1171,6 +1181,7 @@ public class GridLayout extends AbstractLayout implements * * @see com.vaadin.ui.Layout.SpacingHandler#isSpacing() */ + @Override public boolean isSpacing() { return getState().isSpacing(); } @@ -1388,12 +1399,14 @@ public class GridLayout extends AbstractLayout implements return null; } + @Override public void addListener(LayoutClickListener listener) { addListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener, LayoutClickListener.clickMethod); } + @Override public void removeListener(LayoutClickListener listener) { removeListener(LayoutClickEventHandler.LAYOUT_CLICK_EVENT_IDENTIFIER, LayoutClickEvent.class, listener); diff --git a/src/com/vaadin/ui/JavaScript.java b/src/com/vaadin/ui/JavaScript.java index 5905b56bfb..807ddceea1 100644 --- a/src/com/vaadin/ui/JavaScript.java +++ b/src/com/vaadin/ui/JavaScript.java @@ -41,6 +41,7 @@ public class JavaScript extends AbstractExtension { */ public JavaScript() { registerRpc(new JavaScriptCallbackRpc() { + @Override public void call(String name, JSONArray arguments) { JavaScriptCallback callback = callbacks.get(name); // TODO handle situation if name is not registered diff --git a/src/com/vaadin/ui/Label.java b/src/com/vaadin/ui/Label.java index e98da384cf..e7ca26faf8 100644 --- a/src/com/vaadin/ui/Label.java +++ b/src/com/vaadin/ui/Label.java @@ -150,6 +150,7 @@ public class Label extends AbstractComponent implements Property, * * @return the value of the label. */ + @Override public String getValue() { if (getPropertyDataSource() == null) { // Use internal value if we are running without a data source @@ -166,6 +167,7 @@ public class Label extends AbstractComponent implements Property, * @param newStringValue * the New value of the label. */ + @Override public void setValue(Object newStringValue) { if (newStringValue != null && newStringValue.getClass() != String.class) { throw new Converter.ConversionException("Value of type " @@ -197,6 +199,7 @@ public class Label extends AbstractComponent implements Property, * * @see com.vaadin.data.Property#getType() */ + @Override public Class getType() { return String.class; } @@ -207,6 +210,7 @@ public class Label extends AbstractComponent implements Property, * @return the data source property. * @see com.vaadin.data.Property.Viewer#getPropertyDataSource() */ + @Override public Property getPropertyDataSource() { return dataSource; } @@ -218,6 +222,7 @@ public class Label extends AbstractComponent implements Property, * the new data source Property * @see com.vaadin.data.Property.Viewer#setPropertyDataSource(com.vaadin.data.Property) */ + @Override public void setPropertyDataSource(Property newDataSource) { // Stops listening the old data source changes if (dataSource != null @@ -314,6 +319,7 @@ public class Label extends AbstractComponent implements Property, * * @see com.vaadin.data.Property.ValueChangeEvent#getProperty() */ + @Override public Property getProperty() { return (Property) getSource(); } @@ -326,6 +332,7 @@ public class Label extends AbstractComponent implements Property, * the Listener to be added. * @see com.vaadin.data.Property.ValueChangeNotifier#addListener(com.vaadin.data.Property.ValueChangeListener) */ + @Override public void addListener(Property.ValueChangeListener listener) { addListener(Label.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); } @@ -337,6 +344,7 @@ public class Label extends AbstractComponent implements Property, * the Listener to be removed. * @see com.vaadin.data.Property.ValueChangeNotifier#removeListener(com.vaadin.data.Property.ValueChangeListener) */ + @Override public void removeListener(Property.ValueChangeListener listener) { removeListener(Label.ValueChangeEvent.class, listener, VALUE_CHANGE_METHOD); @@ -355,6 +363,7 @@ public class Label extends AbstractComponent implements Property, * * @see com.vaadin.data.Property.ValueChangeListener#valueChange(Property.ValueChangeEvent) */ + @Override public void valueChange(Property.ValueChangeEvent event) { // Update the internal value from the data source getState().setText(getValue()); @@ -399,6 +408,7 @@ public class Label extends AbstractComponent implements Property, * less than, equal to, or greater than the specified object. * @see java.lang.Comparable#compareTo(java.lang.Object) */ + @Override public int compareTo(Label other) { String thisValue = getComparableValue(); diff --git a/src/com/vaadin/ui/Link.java b/src/com/vaadin/ui/Link.java index db0dc58e6b..fd105f3255 100644 --- a/src/com/vaadin/ui/Link.java +++ b/src/com/vaadin/ui/Link.java @@ -96,6 +96,7 @@ public class Link extends AbstractComponent implements Vaadin6Component { * @throws PaintException * if the paint operation failed. */ + @Override public void paintContent(PaintTarget target) throws PaintException { if (resource != null) { @@ -234,6 +235,7 @@ public class Link extends AbstractComponent implements Vaadin6Component { requestRepaint(); } + @Override public void changeVariables(Object source, Map variables) { // TODO Remove once Vaadin6Component is no longer implemented } diff --git a/src/com/vaadin/ui/LoginForm.java b/src/com/vaadin/ui/LoginForm.java index 1d5203bc6b..2d4513c5e3 100644 --- a/src/com/vaadin/ui/LoginForm.java +++ b/src/com/vaadin/ui/LoginForm.java @@ -48,33 +48,40 @@ public class LoginForm extends CustomComponent { private ApplicationResource loginPage = new ApplicationResource() { + @Override public Application getApplication() { return LoginForm.this.getApplication(); } + @Override public int getBufferSize() { return getLoginHTML().length; } + @Override public long getCacheTime() { return -1; } + @Override public String getFilename() { return "login"; } + @Override public DownloadStream getStream() { return new DownloadStream(new ByteArrayInputStream(getLoginHTML()), getMIMEType(), getFilename()); } + @Override public String getMIMEType() { return "text/html; charset=utf-8"; } }; private final RequestHandler requestHandler = new RequestHandler() { + @Override public boolean handleRequest(Application application, WrappedRequest request, WrappedResponse response) throws IOException { diff --git a/src/com/vaadin/ui/MenuBar.java b/src/com/vaadin/ui/MenuBar.java index f94bd7ea64..5b5dc13e20 100644 --- a/src/com/vaadin/ui/MenuBar.java +++ b/src/com/vaadin/ui/MenuBar.java @@ -39,6 +39,7 @@ public class MenuBar extends AbstractComponent implements Vaadin6Component { private boolean htmlContentAllowed; /** Paint (serialise) the component for the client. */ + @Override public void paintContent(PaintTarget target) throws PaintException { target.addAttribute(VMenuBar.OPEN_ROOT_MENU_ON_HOWER, openRootOnHover); @@ -125,6 +126,7 @@ public class MenuBar extends AbstractComponent implements Vaadin6Component { } /** Deserialize changes received from client. */ + @Override public void changeVariables(Object source, Map variables) { Stack items = new Stack(); boolean found = false; diff --git a/src/com/vaadin/ui/OptionGroup.java b/src/com/vaadin/ui/OptionGroup.java index a4aaf7ec99..e3bcdd61b7 100644 --- a/src/com/vaadin/ui/OptionGroup.java +++ b/src/com/vaadin/ui/OptionGroup.java @@ -75,20 +75,24 @@ public class OptionGroup extends AbstractSelect implements } } + @Override public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } + @Override public void removeListener(BlurListener listener) { removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } + @Override public void addListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } + @Override public void removeListener(FocusListener listener) { removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); diff --git a/src/com/vaadin/ui/Panel.java b/src/com/vaadin/ui/Panel.java index c339100cda..bb18780815 100644 --- a/src/com/vaadin/ui/Panel.java +++ b/src/com/vaadin/ui/Panel.java @@ -49,6 +49,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, protected ActionManager actionManager; private PanelServerRpc rpc = new PanelServerRpc() { + @Override public void click(MouseEventDetails mouseDetails) { fireEvent(new ClickEvent(Panel.this, mouseDetails)); } @@ -188,6 +189,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * com.vaadin.terminal.Vaadin6Component#paintContent(com.vaadin.terminal * .PaintTarget) */ + @Override public void paintContent(PaintTarget target) throws PaintException { if (actionManager != null) { actionManager.paintActions(null, target); @@ -229,6 +231,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * @return the Iterator of the components inside the container. * @see com.vaadin.ui.ComponentContainer#getComponentIterator() */ + @Override public Iterator getComponentIterator() { return Collections.singleton((Component) content).iterator(); } @@ -239,6 +242,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.terminal.VariableOwner#changeVariables(Object, Map) */ + @Override @SuppressWarnings("unchecked") public void changeVariables(Object source, Map variables) { // Get new size @@ -277,6 +281,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.terminal.Scrollable#setScrollable(boolean) */ + @Override public int getScrollLeft() { return getState().getScrollLeft(); } @@ -286,6 +291,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.terminal.Scrollable#setScrollable(boolean) */ + @Override public int getScrollTop() { return getState().getScrollTop(); } @@ -295,6 +301,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.terminal.Scrollable#setScrollLeft(int) */ + @Override public void setScrollLeft(int scrollLeft) { if (scrollLeft < 0) { throw new IllegalArgumentException( @@ -309,6 +316,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.terminal.Scrollable#setScrollTop(int) */ + @Override public void setScrollTop(int scrollTop) { if (scrollTop < 0) { throw new IllegalArgumentException( @@ -319,6 +327,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, } /* Documented in superclass */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { content.replaceComponent(oldComponent, newComponent); @@ -329,6 +338,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.ui.ComponentContainer.ComponentAttachListener#componentAttachedToContainer(com.vaadin.ui.ComponentContainer.ComponentAttachEvent) */ + @Override public void componentAttachedToContainer(ComponentAttachEvent event) { if (event.getContainer() == content) { fireComponentAttachEvent(event.getAttachedComponent()); @@ -340,6 +350,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.ui.ComponentContainer.ComponentDetachListener#componentDetachedFromContainer(com.vaadin.ui.ComponentContainer.ComponentDetachEvent) */ + @Override public void componentDetachedFromContainer(ComponentDetachEvent event) { if (event.getContainer() == content) { fireComponentDetachEvent(event.getDetachedComponent()); @@ -367,11 +378,13 @@ public class Panel extends AbstractComponentContainer implements Scrollable, return actionManager; } + @Override public void addAction( T action) { getActionManager().addAction(action); } + @Override public void removeAction( T action) { if (actionManager != null) { @@ -379,10 +392,12 @@ public class Panel extends AbstractComponentContainer implements Scrollable, } } + @Override public void addActionHandler(Handler actionHandler) { getActionManager().addActionHandler(actionHandler); } + @Override public void removeActionHandler(Handler actionHandler) { if (actionManager != null) { actionManager.removeActionHandler(actionHandler); @@ -429,6 +444,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /** * {@inheritDoc} */ + @Override public int getTabIndex() { return getState().getTabIndex(); } @@ -436,6 +452,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /** * {@inheritDoc} */ + @Override public void setTabIndex(int tabIndex) { getState().setTabIndex(tabIndex); requestRepaint(); @@ -455,6 +472,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * * @see com.vaadin.ui.ComponentContainer#getComponentCount() */ + @Override public int getComponentCount() { // This is so wrong... (#2924) return content.getComponentCount(); diff --git a/src/com/vaadin/ui/PopupView.java b/src/com/vaadin/ui/PopupView.java index 911d926053..766181b50f 100644 --- a/src/com/vaadin/ui/PopupView.java +++ b/src/com/vaadin/ui/PopupView.java @@ -58,10 +58,12 @@ public class PopupView extends AbstractComponentContainer implements first = (component == null); } + @Override public boolean hasNext() { return !first; } + @Override public Component next() { if (!first) { first = true; @@ -71,6 +73,7 @@ public class PopupView extends AbstractComponentContainer implements } } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -90,10 +93,12 @@ public class PopupView extends AbstractComponentContainer implements */ public PopupView(final java.lang.String small, final Component large) { this(new PopupView.Content() { + @Override public java.lang.String getMinimizedValueAsHTML() { return small; } + @Override public Component getPopupComponent() { return large; } @@ -223,6 +228,7 @@ public class PopupView extends AbstractComponentContainer implements * * @see com.vaadin.ui.ComponentContainer#getComponentIterator() */ + @Override public Iterator getComponentIterator() { return new SingleComponentIterator(visibleComponent); } @@ -233,6 +239,7 @@ public class PopupView extends AbstractComponentContainer implements * * @return the number of contained components (zero or one) */ + @Override public int getComponentCount() { return (visibleComponent != null ? 1 : 0); } @@ -280,6 +287,7 @@ public class PopupView extends AbstractComponentContainer implements * com.vaadin.ui.Component) * @throws UnsupportedOperationException */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) throws UnsupportedOperationException { @@ -307,6 +315,7 @@ public class PopupView extends AbstractComponentContainer implements * * @see com.vaadin.ui.AbstractComponent#paintContent(com.vaadin.terminal.PaintTarget) */ + @Override public void paintContent(PaintTarget target) throws PaintException { String html = content.getMinimizedValueAsHTML(); if (html == null) { @@ -331,6 +340,7 @@ public class PopupView extends AbstractComponentContainer implements * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object, * java.util.Map) */ + @Override public void changeVariables(Object source, Map variables) { if (variables.containsKey("popupVisibility")) { setPopupVisible(((Boolean) variables.get("popupVisibility")) diff --git a/src/com/vaadin/ui/ProgressIndicator.java b/src/com/vaadin/ui/ProgressIndicator.java index 4d585cfdd7..fef54a267c 100644 --- a/src/com/vaadin/ui/ProgressIndicator.java +++ b/src/com/vaadin/ui/ProgressIndicator.java @@ -111,6 +111,7 @@ public class ProgressIndicator extends AbstractField implements * @throws PaintException * if the Paint Operation fails. */ + @Override public void paintContent(PaintTarget target) throws PaintException { target.addAttribute("indeterminate", indeterminate); target.addAttribute("pollinginterval", pollingInterval); @@ -247,6 +248,7 @@ public class ProgressIndicator extends AbstractField implements return pollingInterval; } + @Override public void changeVariables(Object source, Map variables) { // TODO Remove once Vaadin6Component is no longer implemented diff --git a/src/com/vaadin/ui/RichTextArea.java b/src/com/vaadin/ui/RichTextArea.java index 16d4761b40..cec952926b 100644 --- a/src/com/vaadin/ui/RichTextArea.java +++ b/src/com/vaadin/ui/RichTextArea.java @@ -103,6 +103,7 @@ public class RichTextArea extends AbstractField implements setCaption(caption); } + @Override public void paintContent(PaintTarget target) throws PaintException { if (selectAll) { target.addAttribute("selectAll", true); @@ -185,6 +186,7 @@ public class RichTextArea extends AbstractField implements } } + @Override public void changeVariables(Object source, Map variables) { // Sets the text if (variables.containsKey("text") && !isReadOnly()) { diff --git a/src/com/vaadin/ui/Select.java b/src/com/vaadin/ui/Select.java index 5398f11391..f60935c64b 100644 --- a/src/com/vaadin/ui/Select.java +++ b/src/com/vaadin/ui/Select.java @@ -677,10 +677,12 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering, super.requestRepaint(); } + @Override public void setFilteringMode(int filteringMode) { this.filteringMode = filteringMode; } + @Override public int getFilteringMode() { return filteringMode; } @@ -719,20 +721,24 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering, return columns; } + @Override public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } + @Override public void removeListener(BlurListener listener) { removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } + @Override public void addListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } + @Override public void removeListener(FocusListener listener) { removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); diff --git a/src/com/vaadin/ui/Slider.java b/src/com/vaadin/ui/Slider.java index dc5dc0be98..94afe4e2bd 100644 --- a/src/com/vaadin/ui/Slider.java +++ b/src/com/vaadin/ui/Slider.java @@ -278,6 +278,7 @@ public class Slider extends AbstractField implements Vaadin6Component { super.setValue(newFieldValue); } + @Override public void paintContent(PaintTarget target) throws PaintException { target.addAttribute("min", min); @@ -307,6 +308,7 @@ public class Slider extends AbstractField implements Vaadin6Component { * @param source * @param variables */ + @Override public void changeVariables(Object source, Map variables) { if (variables.containsKey("value")) { final Object value = variables.get("value"); diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java index 061809de67..c52e9394c0 100644 --- a/src/com/vaadin/ui/TabSheet.java +++ b/src/com/vaadin/ui/TabSheet.java @@ -109,6 +109,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, setImmediate(true); setCloseHandler(new CloseHandler() { + @Override public void onTabClose(TabSheet tabsheet, Component c) { tabsheet.removeComponent(c); } @@ -122,6 +123,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * @return the unmodifiable Iterator of the tab content components */ + @Override public Iterator getComponentIterator() { return Collections.unmodifiableList(components).iterator(); } @@ -133,6 +135,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * @return the number of contained components */ + @Override public int getComponentCount() { return components.size(); } @@ -366,6 +369,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * if the paint operation failed. */ + @Override public void paintContent(PaintTarget target) throws PaintException { if (areTabsHidden()) { @@ -691,6 +695,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, // inherits javadoc + @Override public void changeVariables(Object source, Map variables) { if (variables.containsKey("selected")) { setSelectedTab(keyMapper.get((String) variables.get("selected"))); @@ -728,6 +733,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * {@inheritDoc} */ + @Override public void replaceComponent(Component oldComponent, Component newComponent) { if (selected == oldComponent) { @@ -1083,28 +1089,34 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * Returns the tab caption. Can never be null. */ + @Override public String getCaption() { return caption; } + @Override public void setCaption(String caption) { this.caption = caption; requestRepaint(); } + @Override public Resource getIcon() { return icon; } + @Override public void setIcon(Resource icon) { this.icon = icon; requestRepaint(); } + @Override public boolean isEnabled() { return enabled; } + @Override public void setEnabled(boolean enabled) { this.enabled = enabled; if (updateSelection()) { @@ -1113,10 +1125,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, requestRepaint(); } + @Override public boolean isVisible() { return visible; } + @Override public void setVisible(boolean visible) { this.visible = visible; if (updateSelection()) { @@ -1125,10 +1139,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, requestRepaint(); } + @Override public boolean isClosable() { return closable; } + @Override public void setClosable(boolean closable) { this.closable = closable; requestRepaint(); @@ -1138,24 +1154,29 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, } + @Override public String getDescription() { return description; } + @Override public void setDescription(String description) { this.description = description; requestRepaint(); } + @Override public ErrorMessage getComponentError() { return componentError; } + @Override public void setComponentError(ErrorMessage componentError) { this.componentError = componentError; requestRepaint(); } + @Override public Component getComponent() { for (Map.Entry entry : tabs.entrySet()) { if (entry.getValue() == this) { @@ -1165,11 +1186,13 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, return null; } + @Override public void setStyleName(String styleName) { this.styleName = styleName; requestRepaint(); } + @Override public String getStyleName() { return styleName; } @@ -1245,29 +1268,35 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, super.focus(); } + @Override public int getTabIndex() { return tabIndex; } + @Override public void setTabIndex(int tabIndex) { this.tabIndex = tabIndex; requestRepaint(); } + @Override public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } + @Override public void removeListener(BlurListener listener) { removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } + @Override public void addListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } + @Override public void removeListener(FocusListener listener) { removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index a1cc4f95fe..274d648d79 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -3681,6 +3681,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.event.Action.Container#addActionHandler(Action.Handler) */ + @Override public void addActionHandler(Action.Handler actionHandler) { if (actionHandler != null) { @@ -3708,6 +3709,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.event.Action.Container#removeActionHandler(Action.Handler) */ + @Override public void removeActionHandler(Action.Handler actionHandler) { if (actionHandlers != null && actionHandlers.contains(actionHandler)) { @@ -4117,6 +4119,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object) */ + @Override public Object nextItemId(Object itemId) { return ((Container.Ordered) items).nextItemId(itemId); } @@ -4128,6 +4131,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object) */ + @Override public Object prevItemId(Object itemId) { return ((Container.Ordered) items).prevItemId(itemId); } @@ -4138,6 +4142,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Ordered#firstItemId() */ + @Override public Object firstItemId() { return ((Container.Ordered) items).firstItemId(); } @@ -4148,6 +4153,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Ordered#lastItemId() */ + @Override public Object lastItemId() { return ((Container.Ordered) items).lastItemId(); } @@ -4159,6 +4165,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object) */ + @Override public boolean isFirstId(Object itemId) { return ((Container.Ordered) items).isFirstId(itemId); } @@ -4170,6 +4177,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object) */ + @Override public boolean isLastId(Object itemId) { return ((Container.Ordered) items).isLastId(itemId); } @@ -4180,6 +4188,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object) */ + @Override public Object addItemAfter(Object previousItemId) throws UnsupportedOperationException { Object itemId = ((Container.Ordered) items) @@ -4197,6 +4206,7 @@ public class Table extends AbstractSelect implements Action.Container, * java.lang.Object) */ + @Override public Item addItemAfter(Object previousItemId, Object newItemId) throws UnsupportedOperationException { Item item = ((Container.Ordered) items).addItemAfter(previousItemId, @@ -4290,6 +4300,7 @@ public class Table extends AbstractSelect implements Action.Container, * */ + @Override public void sort(Object[] propertyId, boolean[] ascending) throws UnsupportedOperationException { final Container c = getContainerDataSource(); @@ -4331,6 +4342,7 @@ public class Table extends AbstractSelect implements Action.Container, * @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds() */ + @Override public Collection getSortableContainerPropertyIds() { final Container c = getContainerDataSource(); if (c instanceof Container.Sortable && isSortEnabled()) { @@ -4544,11 +4556,13 @@ public class Table extends AbstractSelect implements Action.Container, public abstract String getStyle(Object itemId, Object propertyId); } + @Override public void addListener(ItemClickListener listener) { addListener(VScrollTable.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener, ItemClickEvent.ITEM_CLICK_METHOD); } + @Override public void removeListener(ItemClickListener listener) { removeListener(VScrollTable.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener); @@ -4625,11 +4639,13 @@ public class Table extends AbstractSelect implements Action.Container, } + @Override public TableTransferable getTransferable(Map rawVariables) { TableTransferable transferable = new TableTransferable(rawVariables); return transferable; } + @Override public DropHandler getDropHandler() { return dropHandler; } @@ -4638,6 +4654,7 @@ public class Table extends AbstractSelect implements Action.Container, this.dropHandler = dropHandler; } + @Override public AbstractSelectTargetDetails translateDropTargetDetails( Map clientVariables) { return new AbstractSelectTargetDetails(clientVariables); @@ -4706,6 +4723,7 @@ public class Table extends AbstractSelect implements Action.Container, * com.vaadin.event.dd.acceptcriteria.AcceptCriterion#accepts(com.vaadin * .event.dd.DragAndDropEvent) */ + @Override @SuppressWarnings("unchecked") public boolean accept(DragAndDropEvent dragEvent) { AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dragEvent @@ -5381,10 +5399,12 @@ public class Table extends AbstractSelect implements Action.Container, super.setVisible(visible); } + @Override public Iterator iterator() { return getComponentIterator(); } + @Override public Iterator getComponentIterator() { if (visibleComponents == null) { Collection empty = Collections.emptyList(); @@ -5394,6 +5414,7 @@ public class Table extends AbstractSelect implements Action.Container, return visibleComponents.iterator(); } + @Override public boolean isComponentVisible(Component childComponent) { return true; } diff --git a/src/com/vaadin/ui/Tree.java b/src/com/vaadin/ui/Tree.java index dacb3a2027..bde58c8b3c 100644 --- a/src/com/vaadin/ui/Tree.java +++ b/src/com/vaadin/ui/Tree.java @@ -721,6 +721,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.data.Container.Hierarchical#areChildrenAllowed(Object) */ + @Override public boolean areChildrenAllowed(Object itemId) { return ((Container.Hierarchical) items).areChildrenAllowed(itemId); } @@ -730,6 +731,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.data.Container.Hierarchical#getChildren(Object) */ + @Override public Collection getChildren(Object itemId) { return ((Container.Hierarchical) items).getChildren(itemId); } @@ -739,6 +741,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.data.Container.Hierarchical#getParent(Object) */ + @Override public Object getParent(Object itemId) { return ((Container.Hierarchical) items).getParent(itemId); } @@ -748,6 +751,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.data.Container.Hierarchical#hasChildren(Object) */ + @Override public boolean hasChildren(Object itemId) { return ((Container.Hierarchical) items).hasChildren(itemId); } @@ -757,6 +761,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.data.Container.Hierarchical#isRoot(Object) */ + @Override public boolean isRoot(Object itemId) { return ((Container.Hierarchical) items).isRoot(itemId); } @@ -766,6 +771,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.data.Container.Hierarchical#rootItemIds() */ + @Override public Collection rootItemIds() { return ((Container.Hierarchical) items).rootItemIds(); } @@ -776,6 +782,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * @see com.vaadin.data.Container.Hierarchical#setChildrenAllowed(Object, * boolean) */ + @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) { final boolean success = ((Container.Hierarchical) items) .setChildrenAllowed(itemId, areChildrenAllowed); @@ -791,6 +798,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * @see com.vaadin.data.Container.Hierarchical#setParent(java.lang.Object , * java.lang.Object) */ + @Override public boolean setParent(Object itemId, Object newParentId) { final boolean success = ((Container.Hierarchical) items).setParent( itemId, newParentId); @@ -1015,6 +1023,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.event.Action.Container#addActionHandler(Action.Handler) */ + @Override public void addActionHandler(Action.Handler actionHandler) { if (actionHandler != null) { @@ -1036,6 +1045,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.event.Action.Container#removeActionHandler(Action.Handler) */ + @Override public void removeActionHandler(Action.Handler actionHandler) { if (actionHandlers != null && actionHandlers.contains(actionHandler)) { @@ -1150,11 +1160,13 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, private DropHandler dropHandler; + @Override public void addListener(ItemClickListener listener) { addListener(VTree.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener, ItemClickEvent.ITEM_CLICK_METHOD); } + @Override public void removeListener(ItemClickListener listener) { removeListener(VTree.ITEM_CLICK_EVENT_ID, ItemClickEvent.class, listener); @@ -1206,6 +1218,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, return super.removeItem(itemId); } + @Override public DropHandler getDropHandler() { return dropHandler; } @@ -1304,6 +1317,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * @see * com.vaadin.event.dd.DropTarget#translateDropTargetDetails(java.util.Map) */ + @Override public TreeTargetDetails translateDropTargetDetails( Map clientVariables) { return new TreeTargetDetails(clientVariables); @@ -1371,6 +1385,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see com.vaadin.event.dd.DragSource#getTransferable(java.util.Map) */ + @Override public Transferable getTransferable(Map payload) { TreeTransferable transferable = new TreeTransferable(this, payload); // updating drag source variables @@ -1418,6 +1433,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#accepts(com.vaadin * .event.dd.DragAndDropEvent) */ + @Override public boolean accept(DragAndDropEvent dragEvent) { AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dragEvent .getTargetDetails(); @@ -1541,6 +1557,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, this.depthToCheck = depthToCheck; } + @Override public boolean accept(DragAndDropEvent dragEvent) { try { TreeTargetDetails eventDetails = (TreeTargetDetails) dragEvent diff --git a/src/com/vaadin/ui/TreeTable.java b/src/com/vaadin/ui/TreeTable.java index 3294f6fab0..6132b652f7 100644 --- a/src/com/vaadin/ui/TreeTable.java +++ b/src/com/vaadin/ui/TreeTable.java @@ -82,6 +82,7 @@ public class TreeTable extends Table implements Hierarchical { * scalability with some container implementations. */ + @Override public int getDepth(Object itemId) { int depth = 0; Hierarchical hierarchicalContainer = getContainerDataSource(); @@ -92,6 +93,7 @@ public class TreeTable extends Table implements Hierarchical { return depth; } + @Override public void containerItemSetChange(ItemSetChangeEvent event) { } @@ -110,44 +112,54 @@ public class TreeTable extends Table implements Hierarchical { return (Collapsible) getContainerDataSource(); } + @Override public void toggleChildVisibility(Object itemId) { c().setCollapsed(itemId, !c().isCollapsed(itemId)); } + @Override public boolean isNodeOpen(Object itemId) { return !c().isCollapsed(itemId); } + @Override public int size() { return TreeTable.super.size(); } + @Override public Object getIdByIndex(int index) { return TreeTable.super.getIdByIndex(index); } + @Override public int indexOfId(Object id) { return TreeTable.super.indexOfId(id); } + @Override public boolean isLastId(Object itemId) { // using the default impl return TreeTable.super.isLastId(itemId); } + @Override public Object lastItemId() { // using the default impl return TreeTable.super.lastItemId(); } + @Override public Object nextItemId(Object itemId) { return TreeTable.super.nextItemId(itemId); } + @Override public Object prevItemId(Object itemId) { return TreeTable.super.prevItemId(itemId); } + @Override public Collection getItemIds() { return TreeTable.super.getItemIds(); } @@ -165,18 +177,22 @@ public class TreeTable extends Table implements Hierarchical { private final HashSet openItems = new HashSet(); + @Override public boolean isNodeOpen(Object itemId) { return openItems.contains(itemId); } + @Override public int size() { return getPreOrder().size(); } + @Override public Collection getItemIds() { return Collections.unmodifiableCollection(getPreOrder()); } + @Override public boolean isLastId(Object itemId) { if (itemId == null) { return false; @@ -185,6 +201,7 @@ public class TreeTable extends Table implements Hierarchical { return itemId.equals(lastItemId()); } + @Override public Object lastItemId() { if (getPreOrder().size() > 0) { return getPreOrder().get(getPreOrder().size() - 1); @@ -193,6 +210,7 @@ public class TreeTable extends Table implements Hierarchical { } } + @Override public Object nextItemId(Object itemId) { int indexOf = getPreOrder().indexOf(itemId); if (indexOf == -1) { @@ -206,6 +224,7 @@ public class TreeTable extends Table implements Hierarchical { } } + @Override public Object prevItemId(Object itemId) { int indexOf = getPreOrder().indexOf(itemId); indexOf--; @@ -216,6 +235,7 @@ public class TreeTable extends Table implements Hierarchical { } } + @Override public void toggleChildVisibility(Object itemId) { boolean removed = openItems.remove(itemId); if (!removed) { @@ -265,10 +285,12 @@ public class TreeTable extends Table implements Hierarchical { } + @Override public int indexOfId(Object id) { return getPreOrder().indexOf(id); } + @Override public Object getIdByIndex(int index) { return getPreOrder().get(index); } @@ -610,36 +632,44 @@ public class TreeTable extends Table implements Hierarchical { return getContainerStrategy().getItemIds(); } + @Override public boolean areChildrenAllowed(Object itemId) { return getContainerDataSource().areChildrenAllowed(itemId); } + @Override public Collection getChildren(Object itemId) { return getContainerDataSource().getChildren(itemId); } + @Override public Object getParent(Object itemId) { return getContainerDataSource().getParent(itemId); } + @Override public boolean hasChildren(Object itemId) { return getContainerDataSource().hasChildren(itemId); } + @Override public boolean isRoot(Object itemId) { return getContainerDataSource().isRoot(itemId); } + @Override public Collection rootItemIds() { return getContainerDataSource().rootItemIds(); } + @Override public boolean setChildrenAllowed(Object itemId, boolean areChildrenAllowed) throws UnsupportedOperationException { return getContainerDataSource().setChildrenAllowed(itemId, areChildrenAllowed); } + @Override public boolean setParent(Object itemId, Object newParentId) throws UnsupportedOperationException { return getContainerDataSource().setParent(itemId, newParentId); diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java index 4dff71e45b..9d533b67f6 100644 --- a/src/com/vaadin/ui/Upload.java +++ b/src/com/vaadin/ui/Upload.java @@ -122,6 +122,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, * @see com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object, * java.util.Map) */ + @Override public void changeVariables(Object source, Map variables) { if (variables.containsKey("pollForStart")) { int id = (Integer) variables.get("pollForStart"); @@ -141,6 +142,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, * @throws PaintException * if the paint operation failed. */ + @Override public void paintContent(PaintTarget target) throws PaintException { if (notStarted) { target.addAttribute("notStarted", true); @@ -782,6 +784,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, * * @see com.vaadin.ui.Component.Focusable#getTabIndex() */ + @Override public int getTabIndex() { return tabIndex; } @@ -791,6 +794,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, * * @see com.vaadin.ui.Component.Focusable#setTabIndex(int) */ + @Override public void setTabIndex(int tabIndex) { this.tabIndex = tabIndex; } @@ -974,20 +978,24 @@ public class Upload extends AbstractComponent implements Component.Focusable, streamVariable = new com.vaadin.terminal.StreamVariable() { private StreamingStartEvent lastStartedEvent; + @Override public boolean listenProgress() { return (progressListeners != null && !progressListeners .isEmpty()); } + @Override public void onProgress(StreamingProgressEvent event) { fireUpdateProgress(event.getBytesReceived(), event.getContentLength()); } + @Override public boolean isInterrupted() { return interrupted; } + @Override public OutputStream getOutputStream() { OutputStream receiveUpload = receiver.receiveUpload( lastStartedEvent.getFileName(), @@ -996,6 +1004,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, return receiveUpload; } + @Override public void streamingStarted(StreamingStartEvent event) { startUpload(); contentLength = event.getContentLength(); @@ -1003,6 +1012,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, lastStartedEvent = event; } + @Override public void streamingFinished(StreamingEndEvent event) { fireUploadSuccess(event.getFileName(), event.getMimeType(), event.getContentLength()); @@ -1010,6 +1020,7 @@ public class Upload extends AbstractComponent implements Component.Focusable, requestRepaint(); } + @Override public void streamingFailed(StreamingErrorEvent event) { Exception exception = event.getException(); if (exception instanceof NoInputStreamException) { diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index e24e62236f..56a9bc0337 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -60,6 +60,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, private WindowServerRpc rpc = new WindowServerRpc() { + @Override public void click(MouseEventDetails mouseDetails) { fireEvent(new ClickEvent(Window.this, mouseDetails)); } @@ -797,11 +798,13 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @see com.vaadin.event.FieldEvents.FocusNotifier#addListener(com.vaadin.event.FieldEvents.FocusListener) */ + @Override public void addListener(FocusListener listener) { addListener(FocusEvent.EVENT_ID, FocusEvent.class, listener, FocusListener.focusMethod); } + @Override public void removeListener(FocusListener listener) { removeListener(FocusEvent.EVENT_ID, FocusEvent.class, listener); } @@ -814,11 +817,13 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @see com.vaadin.event.FieldEvents.BlurNotifier#addListener(com.vaadin.event.FieldEvents.BlurListener) */ + @Override public void addListener(BlurListener listener) { addListener(BlurEvent.EVENT_ID, BlurEvent.class, listener, BlurListener.blurMethod); } + @Override public void removeListener(BlurListener listener) { removeListener(BlurEvent.EVENT_ID, BlurEvent.class, listener); } diff --git a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java index 6cbe675fa1..d703fb0364 100644 --- a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java @@ -62,6 +62,7 @@ public abstract class AbstractContainerTest extends TestCase { protected static class ItemSetChangeCounter extends AbstractEventCounter implements ItemSetChangeListener { + @Override public void containerItemSetChange(ItemSetChangeEvent event) { increment(); } diff --git a/tests/server-side/com/vaadin/data/util/BeanContainerTest.java b/tests/server-side/com/vaadin/data/util/BeanContainerTest.java index d9fa8d896e..9037e303a8 100644 --- a/tests/server-side/com/vaadin/data/util/BeanContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/BeanContainerTest.java @@ -18,6 +18,7 @@ public class BeanContainerTest extends AbstractBeanContainerTest { protected static class PersonNameResolver implements BeanIdResolver { + @Override public String getIdForBean(Person bean) { return bean != null ? bean.getName() : null; } @@ -27,6 +28,7 @@ public class BeanContainerTest extends AbstractBeanContainerTest { protected static class NullResolver implements BeanIdResolver { + @Override public String getIdForBean(Person bean) { return null; } @@ -332,6 +334,7 @@ public class BeanContainerTest extends AbstractBeanContainerTest { container .setBeanIdResolver(new BeanIdResolver() { + @Override public String getIdForBean(Person bean) { return bean.getName(); } diff --git a/tests/server-side/com/vaadin/data/util/BeanItemTest.java b/tests/server-side/com/vaadin/data/util/BeanItemTest.java index 51e11260f5..e1ad75796c 100644 --- a/tests/server-side/com/vaadin/data/util/BeanItemTest.java +++ b/tests/server-side/com/vaadin/data/util/BeanItemTest.java @@ -127,6 +127,7 @@ public class BeanItemTest extends TestCase { public void setSub(int i); + @Override public int getOverride(); public void setOverride(int i); diff --git a/tests/server-side/com/vaadin/data/util/TestContainerSorting.java b/tests/server-side/com/vaadin/data/util/TestContainerSorting.java index 9e69b94fbb..497699605a 100644 --- a/tests/server-side/com/vaadin/data/util/TestContainerSorting.java +++ b/tests/server-side/com/vaadin/data/util/TestContainerSorting.java @@ -205,6 +205,7 @@ public class TestContainerSorting extends TestCase { public class MyObject implements Comparable { private String data; + @Override public int compareTo(MyObject o) { if (o == null) { return 1; diff --git a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java index 60894dbe6f..9e0558a122 100644 --- a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java +++ b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java @@ -176,11 +176,13 @@ public class TestHierarchicalContainer extends // Dummy filter that does not remove any items c.addContainerFilter(new Filter() { + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { return true; } + @Override public boolean appliesToProperty(Object propertyId) { return true; } diff --git a/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java b/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java index efc31f0bd4..6f96c3a51a 100644 --- a/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java +++ b/tests/server-side/com/vaadin/data/util/filter/AbstractFilterTest.java @@ -24,22 +24,27 @@ public abstract class AbstractFilterTest extends protected static class NullProperty implements Property { + @Override public String getValue() { return null; } + @Override public void setValue(Object newValue) throws ReadOnlyException { throw new ReadOnlyException(); } + @Override public Class getType() { return String.class; } + @Override public boolean isReadOnly() { return true; } + @Override public void setReadOnly(boolean newStatus) { // do nothing } @@ -60,11 +65,13 @@ public abstract class AbstractFilterTest extends this.propertyId = propertyId; } + @Override public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException { return this.item == item; } + @Override public boolean appliesToProperty(Object propertyId) { return this.propertyId != null ? this.propertyId.equals(propertyId) : true; diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java index c273bbf590..6649bc16e8 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/SQLContainerTest.java @@ -323,6 +323,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1132,6 +1133,7 @@ public class SQLContainerTest { delegate.storeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer() { + @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1163,6 +1165,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1231,6 +1234,7 @@ public class SQLContainerTest { delegate.storeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer() { + @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1262,6 +1266,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1337,6 +1342,7 @@ public class SQLContainerTest { delegate.removeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer() { + @Override public Boolean answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1352,6 +1358,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1414,6 +1421,7 @@ public class SQLContainerTest { delegate.storeRow(EasyMock.isA(Connection.class), EasyMock.isA(RowItem.class))) .andAnswer(new IAnswer() { + @Override public Integer answer() throws Throwable { Connection conn = (Connection) EasyMock .getCurrentArguments()[0]; @@ -1432,6 +1440,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1644,6 +1653,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -1655,6 +1665,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1756,6 +1767,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -1767,6 +1779,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1861,6 +1874,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -1872,6 +1886,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1882,6 +1897,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -1931,6 +1947,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -1942,6 +1959,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -1952,6 +1970,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2000,6 +2019,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -2011,6 +2031,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2021,6 +2042,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); StringBuffer query = new StringBuffer( @@ -2069,6 +2091,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -2080,6 +2103,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2090,6 +2114,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2145,6 +2170,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -2156,6 +2182,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2166,6 +2193,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2221,6 +2249,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -2232,6 +2261,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -2242,6 +2272,7 @@ public class SQLContainerTest { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); @@ -2323,6 +2354,7 @@ public class SQLContainerTest { EasyMock.expectLastCall().anyTimes(); delegate.setOrderBy(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -2334,6 +2366,7 @@ public class SQLContainerTest { EasyMock.expect( delegate.getQueryString(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public String answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java index 75ab455678..a12786f13a 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/TicketTests.java @@ -64,6 +64,7 @@ public class TicketTests { EasyMock.expectLastCall().anyTimes(); delegate.setFilters(EasyMock.isA(List.class)); EasyMock.expectLastCall().andAnswer(new IAnswer() { + @Override public Object answer() throws Throwable { List orders = (List) EasyMock .getCurrentArguments()[0]; @@ -75,6 +76,7 @@ public class TicketTests { EasyMock.expect( delegate.getQueryStatement(EasyMock.anyInt(), EasyMock.anyInt())) .andAnswer(new IAnswer() { + @Override public StatementHelper answer() throws Throwable { Object[] args = EasyMock.getCurrentArguments(); int offset = (Integer) (args[0]); @@ -85,6 +87,7 @@ public class TicketTests { }).anyTimes(); EasyMock.expect(delegate.getCountStatement()) .andAnswer(new IAnswer() { + @Override @SuppressWarnings("deprecation") public StatementHelper answer() throws Throwable { StatementHelper sh = new StatementHelper(); diff --git a/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java b/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java index 3ee260245a..324899e373 100644 --- a/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java +++ b/tests/server-side/com/vaadin/data/util/sqlcontainer/connection/MockInitialContextFactory.java @@ -22,6 +22,7 @@ public class MockInitialContextFactory implements InitialContextFactory { mockCtx = ctx; } + @Override public Context getInitialContext(java.util.Hashtable environment) throws NamingException { if (mockCtx == null) { diff --git a/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java b/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java index 7e45ea50d7..38fca09157 100644 --- a/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java +++ b/tests/server-side/com/vaadin/terminal/gwt/server/TestAbstractApplicationServletStaticFilesLocation.java @@ -46,29 +46,35 @@ public class TestAbstractApplicationServletStaticFilesLocation extends TestCase public class DummyServletConfig implements ServletConfig { // public DummyServletConfig(Map initParameters, ) + @Override public String getInitParameter(String name) { // TODO Auto-generated method stub return null; } + @Override public Enumeration getInitParameterNames() { return new Enumeration() { + @Override public boolean hasMoreElements() { return false; } + @Override public Object nextElement() { return null; } }; } + @Override public ServletContext getServletContext() { // TODO Auto-generated method stub return null; } + @Override public String getServletName() { // TODO Auto-generated method stub return null; diff --git a/tests/server-side/com/vaadin/tests/VaadinClasses.java b/tests/server-side/com/vaadin/tests/VaadinClasses.java index 0ee193e8f1..2f937bf58d 100644 --- a/tests/server-side/com/vaadin/tests/VaadinClasses.java +++ b/tests/server-side/com/vaadin/tests/VaadinClasses.java @@ -164,6 +164,7 @@ public class VaadinClasses { Collections.sort(classes, new Comparator>() { + @Override public int compare(Class o1, Class o2) { return o1.getName().compareTo(o2.getName()); } diff --git a/tests/server-side/com/vaadin/tests/data/converter/ConverterFactory.java b/tests/server-side/com/vaadin/tests/data/converter/ConverterFactory.java index 4bd9cf0cf7..19a470d816 100644 --- a/tests/server-side/com/vaadin/tests/data/converter/ConverterFactory.java +++ b/tests/server-side/com/vaadin/tests/data/converter/ConverterFactory.java @@ -16,20 +16,24 @@ public class ConverterFactory extends TestCase { public static class ConvertTo42 implements Converter { + @Override public Integer convertToModel(String value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { return 42; } + @Override public String convertToPresentation(Integer value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { return "42"; } + @Override public Class getModelType() { return Integer.class; } + @Override public Class getPresentationType() { return String.class; } diff --git a/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java b/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java index 9906990165..f02e5d2932 100644 --- a/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java +++ b/tests/server-side/com/vaadin/tests/server/SourceFileChecker.java @@ -148,6 +148,7 @@ public class SourceFileChecker extends TestCase { } abstract class FileContentsValidator implements FileValidator { + @Override public void validateFile(File f) throws Exception { FileInputStream fis = new FileInputStream(f); String contents = IOUtils.toString(fis); diff --git a/tests/server-side/com/vaadin/tests/server/TestEventRouter.java b/tests/server-side/com/vaadin/tests/server/TestEventRouter.java index dc388a66ac..a8f5039042 100644 --- a/tests/server-side/com/vaadin/tests/server/TestEventRouter.java +++ b/tests/server-side/com/vaadin/tests/server/TestEventRouter.java @@ -15,9 +15,11 @@ public class TestEventRouter extends TestCase { final ValueChangeListener outer = new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { ValueChangeListener inner = new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { innerListenerCalls++; System.out.println("The inner listener was called"); diff --git a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java index 8cc26a5c7f..b567617fdd 100644 --- a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java +++ b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java @@ -46,6 +46,7 @@ public class TransactionListenersConcurrency extends TestCase { for (int i = 0; i < 5; i++) { Thread t = new Thread(new Runnable() { + @Override public void run() { Application app = new Application() { @@ -98,6 +99,7 @@ public class TransactionListenersConcurrency extends TestCase { threads.add(t); t.setUncaughtExceptionHandler(new UncaughtExceptionHandler() { + @Override public void uncaughtException(Thread t, Throwable e) { e = e.getCause(); exceptions.add(e); @@ -163,6 +165,7 @@ public class TransactionListenersConcurrency extends TestCase { this.delay = delay; } + @Override public void transactionStart(Application application, Object transactionData) { try { @@ -173,6 +176,7 @@ public class TransactionListenersConcurrency extends TestCase { } + @Override public void transactionEnd(Application application, Object transactionData) { try { diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java index 446228583a..57af748247 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/AbstractFieldValueConversions.java @@ -37,18 +37,22 @@ public class AbstractFieldValueConversions extends TestCase { TextField tf = new TextField(); tf.setConverter(new Converter() { + @Override public String convertToModel(String value, Locale locale) { return value; } + @Override public String convertToPresentation(String value, Locale locale) { return value; } + @Override public Class getModelType() { return String.class; } + @Override public Class getPresentationType() { return String.class; } @@ -67,19 +71,23 @@ public class AbstractFieldValueConversions extends TestCase { TextField tf = new TextField(); tf.setConverter(new Converter() { + @Override public Integer convertToModel(String value, Locale locale) { throw new ConversionException("Failed"); } + @Override public String convertToPresentation(Integer value, Locale locale) { throw new ConversionException("Failed"); } + @Override public Class getModelType() { // TODO Auto-generated method stub return null; } + @Override public Class getPresentationType() { // TODO Auto-generated method stub return null; @@ -112,6 +120,7 @@ public class AbstractFieldValueConversions extends TestCase { CheckBox cb = new CheckBox(); cb.setConverter(new Converter() { + @Override public Boolean convertToModel(Boolean value, Locale locale) { // value from a CheckBox should never be null as long as it is // not set to null (handled by conversion below). @@ -119,6 +128,7 @@ public class AbstractFieldValueConversions extends TestCase { return value; } + @Override public Boolean convertToPresentation(Boolean value, Locale locale) { // Datamodel -> field if (value == null) { @@ -128,10 +138,12 @@ public class AbstractFieldValueConversions extends TestCase { return value; } + @Override public Class getModelType() { return Boolean.class; } + @Override public Class getPresentationType() { return Boolean.class; } diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java index 94385700d8..f66f523770 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java @@ -60,15 +60,18 @@ public class RemoveListenersOnDetach { }; Property property = new AbstractProperty() { + @Override public Object getValue() { return null; } + @Override public void setValue(Object newValue) throws ReadOnlyException, ConversionException { fireValueChange(); } + @Override public Class getType() { return String.class; } diff --git a/tests/server-side/com/vaadin/tests/server/component/button/ButtonClick.java b/tests/server-side/com/vaadin/tests/server/component/button/ButtonClick.java index 464d131996..4fe499a0a0 100644 --- a/tests/server-side/com/vaadin/tests/server/component/button/ButtonClick.java +++ b/tests/server-side/com/vaadin/tests/server/component/button/ButtonClick.java @@ -38,6 +38,7 @@ public class ButtonClick { private Button getButton() { Button b = new Button(); b.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent ev) { clicked = true; } diff --git a/tests/server-side/com/vaadin/tests/server/component/menubar/MenuBarIds.java b/tests/server-side/com/vaadin/tests/server/component/menubar/MenuBarIds.java index a0dadf8cc6..f304315ebc 100644 --- a/tests/server-side/com/vaadin/tests/server/component/menubar/MenuBarIds.java +++ b/tests/server-side/com/vaadin/tests/server/component/menubar/MenuBarIds.java @@ -87,6 +87,7 @@ public class MenuBarIds extends TestCase implements Command { } } + @Override public void menuSelected(MenuItem selectedItem) { assertNull("lastSelectedItem was not cleared before selecting an item", lastSelectedItem); diff --git a/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java b/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java index c6af98a873..bd6dd6c7b1 100644 --- a/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java +++ b/tests/server-side/com/vaadin/tests/server/component/textfield/TextFieldWithPropertyFormatter.java @@ -57,6 +57,7 @@ public class TextFieldWithPropertyFormatter extends TestCase { listener = new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { listenerCalled++; assertEquals(1, listenerCalled); diff --git a/tests/server-side/com/vaadin/tests/server/component/tree/TestListeners.java b/tests/server-side/com/vaadin/tests/server/component/tree/TestListeners.java index 49610ff293..4984cf161b 100644 --- a/tests/server-side/com/vaadin/tests/server/component/tree/TestListeners.java +++ b/tests/server-side/com/vaadin/tests/server/component/tree/TestListeners.java @@ -121,12 +121,14 @@ public class TestListeners extends TestCase implements ExpandListener, assertEquals(0, collapseCalled); } + @Override public void nodeExpand(ExpandEvent event) { lastExpanded = event.getItemId(); expandCalled++; } + @Override public void nodeCollapse(CollapseEvent event) { lastCollapsed = event.getItemId(); collapseCalled++; diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java index 7423ba8669..e1435ea2ab 100644 --- a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java +++ b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java @@ -47,14 +47,17 @@ public class AttachDetachWindow { windowDetachCalled = true; } + @Override public boolean attachCalled() { return windowAttachCalled; } + @Override public boolean detachCalled() { return windowDetachCalled; } + @Override public TestContent getTestContent() { return testContent; } @@ -111,14 +114,17 @@ public class AttachDetachWindow { // Do nothing } + @Override public boolean attachCalled() { return rootAttachCalled; } + @Override public boolean detachCalled() { return rootDetachCalled; } + @Override public TestContent getTestContent() { return testContent; } diff --git a/tests/server-side/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java b/tests/server-side/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java index 1e01d9a55f..3ba1c4c7f1 100644 --- a/tests/server-side/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java +++ b/tests/server-side/com/vaadin/tests/server/components/ComponentAttachDetachListenerTest.java @@ -46,6 +46,7 @@ public class ComponentAttachDetachListenerTest extends TestCase { private ComponentPosition componentPosition = null; private class MyAttachListener implements ComponentAttachListener { + @Override public void componentAttachedToContainer(ComponentAttachEvent event) { attachCounter++; attachedComponent = event.getAttachedComponent(); @@ -75,6 +76,7 @@ public class ComponentAttachDetachListenerTest extends TestCase { } private class MyDetachListener implements ComponentDetachListener { + @Override public void componentDetachedFromContainer(ComponentDetachEvent event) { detachCounter++; detachedComponent = event.getDetachedComponent(); diff --git a/tests/server-side/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java b/tests/server-side/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java index fc0d1b60a0..58bc2c4d4c 100644 --- a/tests/server-side/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java +++ b/tests/server-side/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java @@ -15,6 +15,7 @@ public class ClassBasedViewProviderTest extends TestCase { public static class TestView extends Label implements View { public String parameters = null; + @Override public void navigateTo(String parameters) { this.parameters = parameters; } diff --git a/tests/server-side/com/vaadin/tests/server/navigator/NavigatorTest.java b/tests/server-side/com/vaadin/tests/server/navigator/NavigatorTest.java index a7eb2e12fd..0507db6700 100644 --- a/tests/server-side/com/vaadin/tests/server/navigator/NavigatorTest.java +++ b/tests/server-side/com/vaadin/tests/server/navigator/NavigatorTest.java @@ -27,16 +27,19 @@ public class NavigatorTest extends TestCase { // TODO test listeners blocking navigation, multiple listeners public static class NullDisplay implements ViewDisplay { + @Override public void showView(View view) { // do nothing } } public static class NullFragmentManager implements FragmentManager { + @Override public String getFragment() { return null; } + @Override public void setFragment(String fragment) { // do nothing } @@ -45,6 +48,7 @@ public class NavigatorTest extends TestCase { public static class TestDisplay implements ViewDisplay { private View currentView; + @Override public void showView(View view) { currentView = view; } @@ -118,6 +122,7 @@ public class NavigatorTest extends TestCase { } } + @Override public boolean isViewChangeAllowed(ViewChangeEvent event) { if (referenceEvents.isEmpty()) { fail("Unexpected call to isViewChangeAllowed()"); @@ -136,6 +141,7 @@ public class NavigatorTest extends TestCase { return returnValue; } + @Override public void navigatorViewChanged(ViewChangeEvent event) { if (referenceEvents.isEmpty()) { fail("Unexpected call to navigatorViewChanged()"); diff --git a/tests/testbench/com/vaadin/launcher/DemoLauncher.java b/tests/testbench/com/vaadin/launcher/DemoLauncher.java index 2b2f73abd6..91cdd343c7 100644 --- a/tests/testbench/com/vaadin/launcher/DemoLauncher.java +++ b/tests/testbench/com/vaadin/launcher/DemoLauncher.java @@ -75,6 +75,7 @@ public class DemoLauncher { * dispatch thread. */ java.awt.EventQueue.invokeLater(new Runnable() { + @Override public void run() { try { openServerControlDialog(url); @@ -125,6 +126,7 @@ public class DemoLauncher { // List for close verify buttons final ActionListener buttonListener = new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { if (e.getSource() == okButton) { System.exit(0); diff --git a/tests/testbench/com/vaadin/tests/Components.java b/tests/testbench/com/vaadin/tests/Components.java index 4352072ccf..b8a007fc1f 100644 --- a/tests/testbench/com/vaadin/tests/Components.java +++ b/tests/testbench/com/vaadin/tests/Components.java @@ -137,6 +137,7 @@ public class Components extends Application.LegacyApplication { naviTree = new Tree(); naviTree.setItemStyleGenerator(new ItemStyleGenerator() { + @Override public String getStyle(Object itemId) { Class cls = (Class) itemId; if (!isAbstract(cls)) { @@ -182,6 +183,7 @@ public class Components extends Application.LegacyApplication { naviTree.addListener(new ItemClickListener() { + @Override public void itemClick(ItemClickEvent event) { Class cls = (Class) event.getItemId(); if (!isAbstract(cls)) { diff --git a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java index 73282cc1fb..1c1adbb80d 100644 --- a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java +++ b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java @@ -45,6 +45,7 @@ public class CustomLayoutDemo extends com.vaadin.Application.LegacyApplication private final Button loginButton = new Button("Login", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { loginClicked(); } @@ -131,6 +132,7 @@ public class CustomLayoutDemo extends com.vaadin.Application.LegacyApplication * Handle all menu events. Updates body panel contents if menu item is * clicked. */ + @Override public void componentEvent(Event event) { // Check if event occured at fsTree component if (event.getSource() == menu) { diff --git a/tests/testbench/com/vaadin/tests/FocusingComponents.java b/tests/testbench/com/vaadin/tests/FocusingComponents.java index e74a935830..f63989fafb 100644 --- a/tests/testbench/com/vaadin/tests/FocusingComponents.java +++ b/tests/testbench/com/vaadin/tests/FocusingComponents.java @@ -54,6 +54,7 @@ public class FocusingComponents extends CustomComponent { Button focus = new Button("focus"); focus.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { f.focus(); } diff --git a/tests/testbench/com/vaadin/tests/ListenerOrder.java b/tests/testbench/com/vaadin/tests/ListenerOrder.java index 797561eb00..7f136b10ed 100644 --- a/tests/testbench/com/vaadin/tests/ListenerOrder.java +++ b/tests/testbench/com/vaadin/tests/ListenerOrder.java @@ -59,6 +59,7 @@ public class ListenerOrder extends com.vaadin.Application.LegacyApplication b1.removeListener(b1Listener); // remove non-existing listener b1.removeListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { } }); @@ -107,6 +108,7 @@ public class ListenerOrder extends com.vaadin.Application.LegacyApplication return listener; } + @Override public void buttonClick(ClickEvent event) { System.out.println("ClickEvent from Test1"); s1.addItem("new item " + System.currentTimeMillis()); @@ -133,6 +135,7 @@ public class ListenerOrder extends com.vaadin.Application.LegacyApplication System.out.println("Created listener " + name + ", id=" + count); } + @Override public void buttonClick(ClickEvent event) { String msg = "ClickEvent from MyClickListener " + name + ", id=" + count; @@ -142,18 +145,21 @@ public class ListenerOrder extends com.vaadin.Application.LegacyApplication } + @Override public void containerPropertySetChange(PropertySetChangeEvent event) { String msg = "containerPropertySetChange from " + this; System.out.println(msg); getMainWindow().showNotification(msg); } + @Override public void containerItemSetChange(ItemSetChangeEvent event) { String msg = "containerItemSetChange from " + this; System.out.println(msg); getMainWindow().showNotification(msg); } + @Override public void valueChange(ValueChangeEvent event) { String msg = "valueChange from " + this; System.out.println(msg); diff --git a/tests/testbench/com/vaadin/tests/ModalWindow.java b/tests/testbench/com/vaadin/tests/ModalWindow.java index c848803642..340571cd37 100644 --- a/tests/testbench/com/vaadin/tests/ModalWindow.java +++ b/tests/testbench/com/vaadin/tests/ModalWindow.java @@ -54,6 +54,7 @@ public class ModalWindow extends com.vaadin.Application.LegacyApplication } + @Override public void buttonClick(ClickEvent event) { if (event.getButton() == reopen) { openSubWindow(); diff --git a/tests/testbench/com/vaadin/tests/NativeWindowing.java b/tests/testbench/com/vaadin/tests/NativeWindowing.java index 6a561dd861..f1b9ce2ff1 100644 --- a/tests/testbench/com/vaadin/tests/NativeWindowing.java +++ b/tests/testbench/com/vaadin/tests/NativeWindowing.java @@ -26,6 +26,7 @@ public class NativeWindowing extends Application.LegacyApplication { main.addComponent(new Button("Add new subwindow", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { final Window w = new Window("sw " + System.currentTimeMillis()); @@ -40,6 +41,7 @@ public class NativeWindowing extends Application.LegacyApplication { final Button closebutton = new Button("Close " + w.getCaption(), new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { main.removeWindow(w); } @@ -78,6 +80,7 @@ public class NativeWindowing extends Application.LegacyApplication { main.addComponent(new Button( "Open a currently uncreated application level window", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { main.open( @@ -114,6 +117,7 @@ public class NativeWindowing extends Application.LegacyApplication { ww.addComponent(new Button("Click me", new Button.ClickListener() { int state = 0; + @Override public void buttonClick(ClickEvent event) { ww.addComponent(new Label("Button clicked " + (++state) + " times")); diff --git a/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java b/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java index 93e6290ee4..af73bdc652 100644 --- a/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java +++ b/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java @@ -60,6 +60,7 @@ public class OrderedLayoutSwapComponents extends CustomComponent { ol.addComponent(new Label(name)); up = new Button("up"); up.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { int newIndex = order.indexOf(MyComponent.this) - 1; MyComponent old = order.get(newIndex); @@ -77,6 +78,7 @@ public class OrderedLayoutSwapComponents extends CustomComponent { down = new Button("down"); down.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { int newIndex = order.indexOf(MyComponent.this) + 1; MyComponent old = order.get(newIndex); diff --git a/tests/testbench/com/vaadin/tests/Parameters.java b/tests/testbench/com/vaadin/tests/Parameters.java index 8d940101c3..1e8ca53875 100644 --- a/tests/testbench/com/vaadin/tests/Parameters.java +++ b/tests/testbench/com/vaadin/tests/Parameters.java @@ -93,6 +93,7 @@ public class Parameters extends com.vaadin.Application.LegacyApplication main.setContent(layout); } + @Override public boolean handleRequest(Application application, WrappedRequest request, WrappedResponse response) throws IOException { diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java index b3f232f24d..be066269c3 100644 --- a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java +++ b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java @@ -39,6 +39,7 @@ public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent { main.addComponent(new Button("click when rendered", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { endTest(); } @@ -47,6 +48,7 @@ public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent { main.addComponent(new Button( "Click for layout repaint (cached components)", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { testContainer.requestRepaint(); } diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java index 882b776d5d..0cd7a5c67d 100644 --- a/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java +++ b/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java @@ -39,6 +39,7 @@ public class PerformanceTestSubTreeCaching extends CustomComponent { addInfo(); Button b = new Button("start test", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { startTest(); } @@ -46,6 +47,7 @@ public class PerformanceTestSubTreeCaching extends CustomComponent { b.setDescription("Push this button to start test. A test label will be rendered above existing components."); main.addComponent(b); b = new Button("end test", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { endTest(); } diff --git a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java index bd40a7fb7b..9cd27e9d5c 100644 --- a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java +++ b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java @@ -73,6 +73,7 @@ public class ScrollbarStressTest extends Application.LegacyApplication { height.setValue("100%"); final Button set = new Button("Set", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { getTable = testComponent.getValue().equals("Table"); diff --git a/tests/testbench/com/vaadin/tests/StressComponentsInTable.java b/tests/testbench/com/vaadin/tests/StressComponentsInTable.java index 9c2703822e..87ab7fa1d4 100644 --- a/tests/testbench/com/vaadin/tests/StressComponentsInTable.java +++ b/tests/testbench/com/vaadin/tests/StressComponentsInTable.java @@ -37,6 +37,7 @@ public class StressComponentsInTable extends CustomComponent { } content.add(new Button("b" + i, new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { Button b = event.getButton(); System.out.println(b.getCaption() + " click: " diff --git a/tests/testbench/com/vaadin/tests/TableChangingDatasource.java b/tests/testbench/com/vaadin/tests/TableChangingDatasource.java index fa7edc3a45..3f87f2fe4c 100644 --- a/tests/testbench/com/vaadin/tests/TableChangingDatasource.java +++ b/tests/testbench/com/vaadin/tests/TableChangingDatasource.java @@ -45,6 +45,7 @@ public class TableChangingDatasource extends CustomComponent implements } + @Override public void buttonClick(ClickEvent event) { int i = mode % 4; t.setContainerDataSource(ta[i].getContainerDataSource()); diff --git a/tests/testbench/com/vaadin/tests/TableSelectTest.java b/tests/testbench/com/vaadin/tests/TableSelectTest.java index 62070c4b97..823bdfb3c4 100644 --- a/tests/testbench/com/vaadin/tests/TableSelectTest.java +++ b/tests/testbench/com/vaadin/tests/TableSelectTest.java @@ -113,6 +113,7 @@ public class TableSelectTest extends CustomComponent implements return id; } + @Override public void valueChange(ValueChangeEvent event) { final Object val = event.getProperty().getValue(); diff --git a/tests/testbench/com/vaadin/tests/TestBench.java b/tests/testbench/com/vaadin/tests/TestBench.java index 1ac497e574..04f71ce535 100644 --- a/tests/testbench/com/vaadin/tests/TestBench.java +++ b/tests/testbench/com/vaadin/tests/TestBench.java @@ -120,6 +120,7 @@ public class TestBench extends com.vaadin.Application.LegacyApplication lo.addComponent(menu); mainWindow.getPage().addListener(new Page.FragmentChangedListener() { + @Override public void fragmentChanged(FragmentChangedEvent source) { String fragment = source.getFragment(); if (fragment != null && !"".equals(fragment)) { @@ -238,6 +239,7 @@ public class TestBench extends com.vaadin.Application.LegacyApplication } // Handle menu selection and update body + @Override public void valueChange(Property.ValueChangeEvent event) { bodyLayout.removeAllComponents(); bodyLayout.setCaption(null); diff --git a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java index 0e49fdd8ae..9f09a3212d 100644 --- a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java +++ b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java @@ -195,6 +195,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener { layout.addComponent(c); } + @Override public void componentEvent(Event event) { final String feedback = eventListenerString + " source=" + event.getSource() + ", toString()=" + event.toString(); diff --git a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java index 3adaff93ea..e13b907f77 100644 --- a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java +++ b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java @@ -43,6 +43,7 @@ public class TestComponentAddAndRecursion extends CustomComponent { Button b = new Button("use gridlayout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { p.setContent(new GridLayout()); p2.setContent(new GridLayout()); @@ -53,6 +54,7 @@ public class TestComponentAddAndRecursion extends CustomComponent { main.addComponent(b); b = new Button("use orderedlayout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { p.setContent(new VerticalLayout()); p2.setContent(new VerticalLayout()); @@ -63,6 +65,7 @@ public class TestComponentAddAndRecursion extends CustomComponent { main.addComponent(b); b = new Button("move B", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { p2.addComponent(l2); } @@ -71,6 +74,7 @@ public class TestComponentAddAndRecursion extends CustomComponent { main.addComponent(b); b = new Button("move p", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { p3.addComponent(p); } @@ -79,6 +83,7 @@ public class TestComponentAddAndRecursion extends CustomComponent { main.addComponent(b); b = new Button("add to both", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { Label l = new Label("both"); p.addComponent(l); @@ -89,6 +94,7 @@ public class TestComponentAddAndRecursion extends CustomComponent { main.addComponent(b); b = new Button("recurse", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { p3.addComponent(p2); @@ -106,6 +112,7 @@ public class TestComponentAddAndRecursion extends CustomComponent { main.addComponent(b); b = new Button("recurse2", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { Panel p = new Panel("dynamic"); p.addComponent(p2); diff --git a/tests/testbench/com/vaadin/tests/TestContainerChanges.java b/tests/testbench/com/vaadin/tests/TestContainerChanges.java index b7f24abd8b..87251c0d65 100644 --- a/tests/testbench/com/vaadin/tests/TestContainerChanges.java +++ b/tests/testbench/com/vaadin/tests/TestContainerChanges.java @@ -70,6 +70,7 @@ public class TestContainerChanges extends CustomComponent { tbl2.setMultiSelect(false); tbl2.setImmediate(true); tbl2.addListener(new Table.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { System.err.println("Value now " + event.getProperty().getValue()); @@ -85,6 +86,7 @@ public class TestContainerChanges extends CustomComponent { Button b = new Button("table.commit()", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { tbl.commit(); } @@ -95,6 +97,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("indexedcontainer.addItem()", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cont.addItem(new Integer(cnt++)); } @@ -104,6 +107,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("indexedcontainer.addItem(null)", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cont.addItem(null); } @@ -113,6 +117,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("indexedcontainer.removeItem(table.lastItemId()", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cont.removeItem(tbl.lastItemId()); } @@ -123,6 +128,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("indexedcontainer.addContainerProperty()", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cont.addContainerProperty("prop" + cnt, String.class, "#" + cnt++); @@ -133,6 +139,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("indexedcontainer.clear()", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cont.removeAllItems(); } @@ -142,6 +149,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("table.setContainerDataSource(indexedcontainer)", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { tbl.setContainerDataSource(cont); } @@ -151,6 +159,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("table.setContainerDataSource(orderedwrapper)", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { tbl.setContainerDataSource(ordered); } @@ -160,6 +169,7 @@ public class TestContainerChanges extends CustomComponent { b = new Button("table.setContainerDataSource(hierarchicalwrapper)", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { tbl.setContainerDataSource(hierarchical); } diff --git a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java index 67370039bb..eadc787ad8 100644 --- a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java +++ b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java @@ -30,6 +30,7 @@ public class TestForBasicApplicationLayout extends CustomComponent { click = new Button("Set height -1", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { tab.setHeight(null); } @@ -38,6 +39,7 @@ public class TestForBasicApplicationLayout extends CustomComponent { click2 = new Button("Set height 100%", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { tab.setHeight(100, TabSheet.UNITS_PERCENTAGE); } diff --git a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java index e90231eefd..3852c5f13f 100644 --- a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java +++ b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java @@ -53,6 +53,7 @@ public class TestForChildComponentRendering extends CustomComponent { se.addItem("Valinta 2"); Button b = new Button("refresh view", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { createNewView(); } @@ -60,6 +61,7 @@ public class TestForChildComponentRendering extends CustomComponent { main.addComponent(b); b = new Button("reorder view", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { randomReorder(); } @@ -68,6 +70,7 @@ public class TestForChildComponentRendering extends CustomComponent { b = new Button("remove randomly one component", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { removeRandomComponent(); } diff --git a/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java b/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java index 92b7ae4f62..f3bd5ab227 100644 --- a/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java +++ b/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java @@ -60,6 +60,7 @@ public class TestForContainerFilterable extends CustomComponent { // Handler filterButton.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { ic.removeAllContainerFilters(); if (fooFilter.getValue().length() > 0) { @@ -77,6 +78,7 @@ public class TestForContainerFilterable extends CustomComponent { // Resetbutton lo.addComponent(new Button("Rebind table datasource", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { t.setContainerDataSource(ic); } diff --git a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java index 6adcf49ec6..982c86781c 100644 --- a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java +++ b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java @@ -54,6 +54,7 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent { main.addComponent(se, 0, 1, 1, 1); Button b = new Button("refresh view", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { createNewView(); } @@ -61,6 +62,7 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent { main.addComponent(b); b = new Button("reorder view", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { randomReorder(); } @@ -69,6 +71,7 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent { b = new Button("remove randomly one component", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { removeRandomComponent(); } diff --git a/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java b/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java index e192d2738d..17c118803b 100644 --- a/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java +++ b/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java @@ -65,6 +65,7 @@ public class TestForMultipleStyleNames extends CustomComponent implements } + @Override public void valueChange(ValueChangeEvent event) { final String currentStyle = l.getStyleName(); diff --git a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java index 8e4ec17738..51db064af2 100644 --- a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java +++ b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java @@ -26,6 +26,7 @@ public class TestForNativeWindowing extends Application.LegacyApplication { main.addComponent(new Button("Add new subwindow", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { final Window w = new Window("sw " + System.currentTimeMillis()); @@ -40,6 +41,7 @@ public class TestForNativeWindowing extends Application.LegacyApplication { final Button closebutton = new Button("Close " + w.getCaption(), new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { main.removeWindow(w); } @@ -78,6 +80,7 @@ public class TestForNativeWindowing extends Application.LegacyApplication { main.addComponent(new Button( "Open a currently uncreated application level window", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { main.open( @@ -114,6 +117,7 @@ public class TestForNativeWindowing extends Application.LegacyApplication { ww.addComponent(new Button("Click me", new Button.ClickListener() { int state = 0; + @Override public void buttonClick(ClickEvent event) { ww.addComponent(new Label("Button clicked " + (++state) + " times")); diff --git a/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java b/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java index 74fdb0c35f..9a41d719d4 100644 --- a/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java +++ b/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java @@ -91,6 +91,7 @@ public class TestForPreconfiguredComponents extends CustomComponent implements main.addComponent(test); final Button b = new Button("refresh view", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { createNewView(); } @@ -146,6 +147,7 @@ public class TestForPreconfiguredComponents extends CustomComponent implements final Panel status = new Panel("Events"); final Button clear = new Button("clear event log"); clear.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { status.removeAllComponents(); status.addComponent(ol2); @@ -162,6 +164,7 @@ public class TestForPreconfiguredComponents extends CustomComponent implements ol.addComponent(status); t.addListener(new Listener() { + @Override public void componentEvent(Event event) { status.addComponent(new Label(event.getClass().getName())); // TODO should not use Field.toString() @@ -173,10 +176,12 @@ public class TestForPreconfiguredComponents extends CustomComponent implements return ol; } + @Override public Action[] getActions(Object target, Object sender) { return actions; } + @Override public void handleAction(Action action, Object sender, Object target) { if (action == actions[1]) { al.addComponent(new Label("Delete selected on " + target)); diff --git a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java index 992222cb9a..7185d2478c 100644 --- a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java +++ b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java @@ -53,6 +53,7 @@ public class TestForRichTextEditor extends CustomComponent implements b.setImmediate(true); b.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { rte.setEnabled(!rte.isEnabled()); } @@ -61,6 +62,7 @@ public class TestForRichTextEditor extends CustomComponent implements } + @Override public void valueChange(ValueChangeEvent event) { l.setValue(rte.getValue()); } diff --git a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java index 1fc20fe3e2..2a350b2fbb 100644 --- a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java +++ b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java @@ -70,6 +70,7 @@ public class TestForStyledUpload extends Application.LegacyApplication up.addListener(new Upload.ProgressListener() { + @Override public void updateProgress(long readBytes, long contentLenght) { pi.setValue(new Float(readBytes / (float) contentLenght)); @@ -83,6 +84,7 @@ public class TestForStyledUpload extends Application.LegacyApplication final Button b = new Button("Update status", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { readState(); } @@ -90,6 +92,7 @@ public class TestForStyledUpload extends Application.LegacyApplication final Button c = new Button("Update status with gc", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { gc(); } @@ -112,6 +115,7 @@ public class TestForStyledUpload extends Application.LegacyApplication Button cancel = new Button("Cancel current upload"); cancel.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { buffer.cancel(); } @@ -122,6 +126,7 @@ public class TestForStyledUpload extends Application.LegacyApplication final Button restart = new Button("Restart demo application"); restart.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { TestForStyledUpload.this.close(); } @@ -156,6 +161,7 @@ public class TestForStyledUpload extends Application.LegacyApplication refreshMemUsage(); } + @Override public void uploadFinished(FinishedEvent event) { status.removeAllComponents(); final InputStream stream = buffer.getStream(); @@ -208,6 +214,7 @@ public class TestForStyledUpload extends Application.LegacyApplication up.interruptUpload(); } + @Override public InputStream getStream() { if (file == null) { return null; @@ -225,6 +232,7 @@ public class TestForStyledUpload extends Application.LegacyApplication /** * @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, String) */ + @Override public OutputStream receiveUpload(String filename, String MIMEType) { fileName = filename; mimeType = MIMEType; @@ -242,6 +250,7 @@ public class TestForStyledUpload extends Application.LegacyApplication * * @return String */ + @Override public String getFileName() { return fileName; } @@ -257,11 +266,13 @@ public class TestForStyledUpload extends Application.LegacyApplication } + @Override public void uploadFailed(FailedEvent event) { pi.setVisible(false); l.setValue("Upload was interrupted"); } + @Override public void uploadSucceeded(SucceededEvent event) { pi.setVisible(false); l.setValue("Finished upload, idle"); @@ -280,6 +291,7 @@ public class TestForStyledUpload extends Application.LegacyApplication } + @Override public void uploadStarted(StartedEvent event) { pi.setVisible(true); l.setValue("Started uploading file " + event.getFilename()); diff --git a/tests/testbench/com/vaadin/tests/TestForTabSheet.java b/tests/testbench/com/vaadin/tests/TestForTabSheet.java index 938bf43115..d180bd4be3 100644 --- a/tests/testbench/com/vaadin/tests/TestForTabSheet.java +++ b/tests/testbench/com/vaadin/tests/TestForTabSheet.java @@ -32,6 +32,7 @@ public class TestForTabSheet extends CustomComponent implements tabsheet.addTab(tab3_root, "Third tab", null); } + @Override public void buttonClick(ClickEvent event) { System.out.println("tab2=" + tab2_root.isEnabled() + " tab3=" + tab3_root.isEnabled()); @@ -39,6 +40,7 @@ public class TestForTabSheet extends CustomComponent implements tab3_root.setEnabled(true); } + @Override public void selectedTabChange(SelectedTabChangeEvent event) { /* * Cast to a TabSheet. This isn't really necessary in this example, as diff --git a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java index 48c056ff58..a8d42184a0 100644 --- a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java @@ -103,6 +103,7 @@ public class TestForTablesInitialColumnWidthLogicRendering extends main.addComponent(t); final Button b = new Button("refresh view", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { createNewView(); } @@ -125,6 +126,7 @@ public class TestForTablesInitialColumnWidthLogicRendering extends } Button button = new Button("b", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { System.out.println("b click"); diff --git a/tests/testbench/com/vaadin/tests/TestForTrees.java b/tests/testbench/com/vaadin/tests/TestForTrees.java index 37030a25c2..24d6102f80 100644 --- a/tests/testbench/com/vaadin/tests/TestForTrees.java +++ b/tests/testbench/com/vaadin/tests/TestForTrees.java @@ -87,6 +87,7 @@ public class TestForTrees extends CustomComponent implements Handler { contextTree = t; final Button b = new Button("refresh view", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { createNewView(); } @@ -131,6 +132,7 @@ public class TestForTrees extends CustomComponent implements Handler { final Panel status = new Panel("Events"); final Button clear = new Button("c"); clear.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { status.removeAllComponents(); status.addComponent(clear); @@ -144,6 +146,7 @@ public class TestForTrees extends CustomComponent implements Handler { ol.addComponent(status); t.addListener(new Listener() { + @Override public void componentEvent(Event event) { status.addComponent(new Label(event.getClass().getName())); // TODO should not use Field.toString() @@ -155,10 +158,12 @@ public class TestForTrees extends CustomComponent implements Handler { return ol; } + @Override public Action[] getActions(Object target, Object sender) { return actions; } + @Override public void handleAction(Action action, Object sender, Object target) { if (action == actions[1]) { al.addComponent(new Label("Delete selected on " + target)); diff --git a/tests/testbench/com/vaadin/tests/TestForUpload.java b/tests/testbench/com/vaadin/tests/TestForUpload.java index c254198add..2f3e814b45 100644 --- a/tests/testbench/com/vaadin/tests/TestForUpload.java +++ b/tests/testbench/com/vaadin/tests/TestForUpload.java @@ -95,6 +95,7 @@ public class TestForUpload extends CustomComponent implements up.addListener(new Listener() { private static final long serialVersionUID = -8319074730512324303L; + @Override public void componentEvent(Event event) { // print out all events fired by upload for debug purposes System.out.println("Upload fired event | " + event); @@ -104,6 +105,7 @@ public class TestForUpload extends CustomComponent implements up.addListener(new StartedListener() { private static final long serialVersionUID = 5508883803861085154L; + @Override public void uploadStarted(StartedEvent event) { pi.setVisible(true); pi2.setVisible(true); @@ -117,6 +119,7 @@ public class TestForUpload extends CustomComponent implements up.addListener(new Upload.FinishedListener() { private static final long serialVersionUID = -3773034195991947371L; + @Override public void uploadFinished(FinishedEvent event) { pi.setVisible(false); pi2.setVisible(false); @@ -156,6 +159,7 @@ public class TestForUpload extends CustomComponent implements up.addListener(new Upload.ProgressListener() { + @Override public void updateProgress(long readBytes, long contentLenght) { pi2.setValue(new Float(readBytes / (float) contentLenght)); @@ -166,12 +170,14 @@ public class TestForUpload extends CustomComponent implements final Button b = new Button("Reed state from upload", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { readState(); } }); final Button c = new Button("Force GC", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { gc(); } @@ -183,6 +189,7 @@ public class TestForUpload extends CustomComponent implements main.addComponent(throwExecption); main.addComponent(interrupt); interrupt.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { up.interruptUpload(); } @@ -195,6 +202,7 @@ public class TestForUpload extends CustomComponent implements uploadBufferSelector.addItem("tempfile"); uploadBufferSelector .addListener(new AbstractField.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { setBuffer(); } @@ -222,6 +230,7 @@ public class TestForUpload extends CustomComponent implements final Button restart = new Button("R"); restart.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { getApplication().close(); } @@ -280,6 +289,7 @@ public class TestForUpload extends CustomComponent implements } + @Override public InputStream getStream() { if (outputBuffer == null) { return null; @@ -290,6 +300,7 @@ public class TestForUpload extends CustomComponent implements /** * @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, String) */ + @Override public OutputStream receiveUpload(String filename, String MIMEType) { fileName = filename; mimeType = MIMEType; @@ -310,6 +321,7 @@ public class TestForUpload extends CustomComponent implements * * @return String */ + @Override public String getFileName() { return fileName; } @@ -344,6 +356,7 @@ public class TestForUpload extends CustomComponent implements } + @Override public InputStream getStream() { if (file == null) { return null; @@ -360,6 +373,7 @@ public class TestForUpload extends CustomComponent implements /** * @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, String) */ + @Override public OutputStream receiveUpload(String filename, String MIMEType) { fileName = filename; mimeType = MIMEType; @@ -387,6 +401,7 @@ public class TestForUpload extends CustomComponent implements * * @return String */ + @Override public String getFileName() { return fileName; } @@ -402,6 +417,7 @@ public class TestForUpload extends CustomComponent implements } + @Override public void updateProgress(long readBytes, long contentLenght) { pi.setValue(new Float(readBytes / (float) contentLenght)); diff --git a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java index 75395f0d5c..761d9bc106 100644 --- a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java +++ b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java @@ -21,6 +21,7 @@ public class TestForWindowOpen extends CustomComponent { main.addComponent(new Button("Open in this window", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { final ExternalResource r = new ExternalResource( "http://www.google.com"); @@ -33,6 +34,7 @@ public class TestForWindowOpen extends CustomComponent { main.addComponent(new Button("Open in target \"mytarget\"", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { final ExternalResource r = new ExternalResource( "http://www.google.com"); @@ -45,6 +47,7 @@ public class TestForWindowOpen extends CustomComponent { main.addComponent(new Button("Open in target \"secondtarget\"", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { final ExternalResource r = new ExternalResource( "http://www.google.com"); diff --git a/tests/testbench/com/vaadin/tests/TestForWindowing.java b/tests/testbench/com/vaadin/tests/TestForWindowing.java index b9e14608f5..bbd523c0fd 100644 --- a/tests/testbench/com/vaadin/tests/TestForWindowing.java +++ b/tests/testbench/com/vaadin/tests/TestForWindowing.java @@ -37,6 +37,7 @@ public class TestForWindowing extends CustomComponent { final Button create = new Button("Create a new window", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { Window w = new Window("Testing Window"); @@ -59,6 +60,7 @@ public class TestForWindowing extends CustomComponent { s1.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { String v = (String) event.getProperty() .getValue(); diff --git a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java index a46253598f..064a04847a 100644 --- a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java +++ b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java @@ -50,6 +50,7 @@ public class TestSetVisibleAndCaching extends selectPanel(selectedPanel); buttonNextPanel.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { selectedPanel++; if (selectedPanel > 2) { diff --git a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java index a9005e7fd3..50028137df 100644 --- a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java +++ b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java @@ -56,6 +56,7 @@ public class TestSizeableIncomponents extends Application.LegacyApplication { prev = new Button("<<-|"); prev.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { Object cur = select.getValue(); Testable prev = (Testable) cont.prevItemId(cur); @@ -71,6 +72,7 @@ public class TestSizeableIncomponents extends Application.LegacyApplication { }); next = new Button("|->>"); next.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { Object cur = select.getValue(); Testable next = (Testable) cont.nextItemId(cur); @@ -93,6 +95,7 @@ public class TestSizeableIncomponents extends Application.LegacyApplication { select.setContainerDataSource(cont); select.addListener(new ComboBox.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { Testable t = (Testable) select.getValue(); if (t != null) { diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystem.java b/tests/testbench/com/vaadin/tests/TreeFilesystem.java index e451d2ced7..736f2cf5af 100644 --- a/tests/testbench/com/vaadin/tests/TreeFilesystem.java +++ b/tests/testbench/com/vaadin/tests/TreeFilesystem.java @@ -60,6 +60,7 @@ public class TreeFilesystem extends com.vaadin.Application.LegacyApplication * Handle tree expand event, populate expanded node's childs with new files * and directories. */ + @Override public void nodeExpand(ExpandEvent event) { final Item i = tree.getItem(event.getItemId()); if (!tree.hasChildren(i)) { diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java index 1b32a35a38..2458f2dfa1 100644 --- a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java +++ b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java @@ -80,6 +80,7 @@ public class TreeFilesystemContainer extends * Listener for any component events. This class has been registered as an * listener for component fsTree. */ + @Override public void componentEvent(Event event) { // Check if event occured at fsTree component if (event.getSource() == filesystem) { diff --git a/tests/testbench/com/vaadin/tests/UpgradingSample.java b/tests/testbench/com/vaadin/tests/UpgradingSample.java index 0db63ca789..3090962b71 100644 --- a/tests/testbench/com/vaadin/tests/UpgradingSample.java +++ b/tests/testbench/com/vaadin/tests/UpgradingSample.java @@ -94,6 +94,7 @@ public class UpgradingSample extends Application.LegacyApplication implements } // Handle menu selection and update visible page + @Override public void valueChange(Property.ValueChangeEvent event) { layout.removeComponent(1, 0); final String title = (String) menu.getValue(); @@ -116,6 +117,7 @@ public class UpgradingSample extends Application.LegacyApplication implements private final Button loginButton = new Button("Enter", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { login(); } @@ -127,6 +129,7 @@ public class UpgradingSample extends Application.LegacyApplication implements private final Button logoutButton = new Button("Logout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { close(); } @@ -163,6 +166,7 @@ public class UpgradingSample extends Application.LegacyApplication implements } // Update login status on application user change events + @Override public void applicationUserChanged(Application.UserChangeEvent event) { updateStatus(); } diff --git a/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java b/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java index 54a7d3d080..94635d17c4 100644 --- a/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java +++ b/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java @@ -51,6 +51,7 @@ public class UsingCustomNewItemHandlerInSelect extends CustomComponent { } public class MyNewItemHandler implements AbstractSelect.NewItemHandler { + @Override public void addNewItem(String newItemCaption) { // here could be db insert or other backend operation Integer id = new Integer(sequence++); diff --git a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java index 13918ace90..f72229ace1 100644 --- a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java +++ b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java @@ -60,6 +60,7 @@ public class UsingObjectsInSelect extends } } + @Override public void valueChange(ValueChangeEvent event) { final Task task = (Task) select.getValue(); selectedTask.setValue("Type: " + task.getType() diff --git a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java index 58faec35f0..fbf9e7b46e 100644 --- a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java +++ b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java @@ -59,6 +59,7 @@ public class GAESyncTest extends Application.LegacyApplication { tf = new TextField("Echo thingie"); tf.setImmediate(true); tf.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { IntrWindow.this.showNotification((String) event .getProperty().getValue()); @@ -73,6 +74,7 @@ public class GAESyncTest extends Application.LegacyApplication { { Button b = new Button("Slow", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { Thread.sleep(15000); @@ -89,6 +91,7 @@ public class GAESyncTest extends Application.LegacyApplication { { Button b = new Button("Add", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { if (getRoot() == getMainWindow()) { getRoot().getPage().showNotification( diff --git a/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java b/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java index ce41a895c4..a59764bf45 100644 --- a/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java +++ b/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java @@ -27,6 +27,7 @@ public class ApplicationCloseTest extends TestBase { Label thisApp = new Label("This applications: " + this); Button close = new Button("Close this", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { event.getButton().getApplication().close(); } diff --git a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java index fcc4e26b55..690df3f360 100644 --- a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java +++ b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java @@ -50,6 +50,7 @@ public class ErrorInUnloadEvent extends AbstractTestCase { mainWindow.setContent(formLayout); login.addListener(new ClickListener() { + @Override public void buttonClick(final ClickEvent event) { String username = userField.getValue(); String password = passwordField.getValue(); @@ -81,6 +82,7 @@ public class ErrorInUnloadEvent extends AbstractTestCase { header.addComponent(title); Button logout = new Button("Logout"); logout.addListener(new ClickListener() { + @Override public void buttonClick(final ClickEvent event) { setUser(null); showLoginWindow(); diff --git a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java index f2ae7a3891..4a029e3373 100644 --- a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java +++ b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java @@ -16,6 +16,7 @@ public class TerminalErrorNotification extends TestBase { Button button = new Button("Throw exception", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { throw new RuntimeException("You asked for it"); } diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java index eeb866138b..def68a7357 100644 --- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java @@ -61,6 +61,7 @@ public class ThreadLocalInstances extends AbstractTestApplication { mainWindow.addComponent(log); mainWindow.addComponent(new Embedded("Icon", resource)); mainWindow.addComponent(new Button("Sync", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { reportCurrentStatus("button listener"); } diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java index a3f11f2cd3..817acf20b5 100644 --- a/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java +++ b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java @@ -18,6 +18,7 @@ public class WebBrowserSizeTest extends TestBase { final Button update = new Button("Refresh", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { screenSizeLabel.setValue(getBrowser().getScreenWidth() + " x " + getBrowser().getScreenHeight()); diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java index 35235bbe1f..004c8f1c91 100644 --- a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java +++ b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java @@ -38,6 +38,7 @@ public class WebBrowserTest extends TestBase { final Button update = new Button("Get TimeZone from browser", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { TimeZone hkiTZ = TimeZone .getTimeZone("Europe/Helsinki"); diff --git a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java index 17ac74e5a3..abcdf232cd 100644 --- a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java +++ b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java @@ -22,6 +22,7 @@ public class ChangeSessionId extends AbstractTestCase { mainWindow.addComponent(new Button("Show session id", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { logSessionId(); } @@ -29,6 +30,7 @@ public class ChangeSessionId extends AbstractTestCase { setMainWindow(mainWindow); loginButton.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { WebApplicationContext context = ((WebApplicationContext) getContext()); diff --git a/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java b/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java index 8723e23a2a..f1730ed5f5 100644 --- a/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java +++ b/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java @@ -15,10 +15,12 @@ public class RemoveTransactionListener extends TestBase { // Add one listener that will remove itself from within transactionEnd getMainWindow().getApplication().getContext() .addTransactionListener(new TransactionListener() { + @Override public void transactionStart(Application application, Object transactionData) { } + @Override public void transactionEnd(Application application, Object transactionData) { removeListener(this); @@ -29,12 +31,14 @@ public class RemoveTransactionListener extends TestBase { // Add one listener that will remove itself from within transactionStart getMainWindow().getApplication().getContext() .addTransactionListener(new TransactionListener() { + @Override public void transactionStart(Application application, Object transactionData) { removeListener(this); log.log("Listener removed in transactionStart"); } + @Override public void transactionEnd(Application application, Object transactionData) { } @@ -45,11 +49,13 @@ public class RemoveTransactionListener extends TestBase { // ignored getMainWindow().getApplication().getContext() .addTransactionListener(new TransactionListener() { + @Override public void transactionStart(Application application, Object transactionData) { log.log("transactionStart from last listener"); } + @Override public void transactionEnd(Application application, Object transactionData) { log.log("transactionEnd from last listener"); diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java index 6e9e4e8930..be3b7760f2 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java @@ -29,6 +29,7 @@ public abstract class AbstractComponentContainerTest addButtonCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { Button b = new Button("A button"); c.addComponent(b); @@ -38,6 +39,7 @@ public abstract class AbstractComponentContainerTest addNativeButtonCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { NativeButton b = new NativeButton("Native button"); c.addComponent(b); @@ -46,6 +48,7 @@ public abstract class AbstractComponentContainerTest addTextAreaCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { TextArea ta = new TextArea(); c.addComponent(ta); @@ -54,6 +57,7 @@ public abstract class AbstractComponentContainerTest addRichTextAreaCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { RichTextArea ta = new RichTextArea(); c.addComponent(ta); @@ -62,6 +66,7 @@ public abstract class AbstractComponentContainerTest addTextFieldCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { TextField tf = new TextField(); c.addComponent(tf); @@ -70,6 +75,7 @@ public abstract class AbstractComponentContainerTest addInlineDateFieldCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { InlineDateField tf = new InlineDateField(); c.addComponent(tf); @@ -77,6 +83,7 @@ public abstract class AbstractComponentContainerTest addPopupDateFieldCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { PopupDateField tf = new PopupDateField(); c.addComponent(tf); @@ -85,6 +92,7 @@ public abstract class AbstractComponentContainerTest addVerticalSplitPanelCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { VerticalSplitPanel vsp = new VerticalSplitPanel(); c.addComponent(vsp); @@ -93,6 +101,7 @@ public abstract class AbstractComponentContainerTest addHorizontalSplitPanelCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { HorizontalSplitPanel vsp = new HorizontalSplitPanel(); c.addComponent(vsp); @@ -101,6 +110,7 @@ public abstract class AbstractComponentContainerTest addTabSheetCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { TabSheet ts = createTabSheet(); c.addComponent(ts); @@ -110,6 +120,7 @@ public abstract class AbstractComponentContainerTest addTableCommand = new Command() { + @Override public void execute(T c, ComponentSize size, Object data) { Table t = createTable(); c.addComponent(t); @@ -117,12 +128,14 @@ public abstract class AbstractComponentContainerTest removeAllComponentsCommand = new Command() { + @Override public void execute(T c, Object value, Object data) { c.removeAllComponents(); } }; private Command removeComponentByIndexCommand = new Command() { + @Override public void execute(T c, Integer value, Object data) { Component child = getComponentAtIndex(c, value); c.removeComponent(child); @@ -131,6 +144,7 @@ public abstract class AbstractComponentContainerTest componentAttachListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { c.addListener((ComponentAttachListener) AbstractComponentContainerTest.this); @@ -142,6 +156,7 @@ public abstract class AbstractComponentContainerTest componentDetachListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { c.addListener((ComponentDetachListener) AbstractComponentContainerTest.this); @@ -153,6 +168,7 @@ public abstract class AbstractComponentContainerTest setComponentHeight = new Command() { + @Override public void execute(T c, Integer value, Object data) { Component child = getComponentAtIndex(c, value); child.setHeight((String) data); @@ -162,6 +178,7 @@ public abstract class AbstractComponentContainerTest setComponentWidth = new Command() { + @Override public void execute(T c, Integer value, Object data) { Component child = getComponentAtIndex(c, value); child.setWidth((String) data); @@ -348,6 +365,7 @@ public abstract class AbstractComponentContainerTest MenuItem showEventLog = settingsMenu.addItem("Show event log", new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { boolean selected = !isSelected(selectedItem); setLogVisible(selected); @@ -131,6 +132,7 @@ public abstract class AbstractComponentTest settingsMenu.addItem("Clear log", new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { log.clear(); } @@ -140,6 +142,7 @@ public abstract class AbstractComponentTest MenuItem layoutHeight = layoutSize.addItem("Height", null); for (final String name : sizeOptions.keySet()) { layoutWidth.addItem(name, new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { getTestComponents().get(0).getParent() .setWidth(sizeOptions.get(name)); @@ -147,6 +150,7 @@ public abstract class AbstractComponentTest } }); layoutHeight.addItem(name, new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { getTestComponents().get(0).getParent() .setHeight(sizeOptions.get(name)); @@ -243,6 +247,7 @@ public abstract class AbstractComponentTest protected Command focusListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { ((FocusNotifier) c).addListener(AbstractComponentTest.this); @@ -253,6 +258,7 @@ public abstract class AbstractComponentTest }; protected Command blurListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { ((BlurNotifier) c).addListener(AbstractComponentTest.this); @@ -469,6 +475,7 @@ public abstract class AbstractComponentTest final Object data) { return new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { boolean selected = !isSelected(selectedItem); doCommand(getText(selectedItem), booleanCommand, selected, data); @@ -483,6 +490,7 @@ public abstract class AbstractComponentTest final DATATYPE value, final Object data) { return new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { doCommand(getText(selectedItem), command, value, data); } @@ -506,6 +514,7 @@ public abstract class AbstractComponentTest final com.vaadin.tests.components.ComponentTestCase.Command cmd, final VALUETYPE object, final Object data) { return new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { doCommand(getText(selectedItem), cmd, object, data); @@ -722,10 +731,12 @@ public abstract class AbstractComponentTest } + @Override public void focus(FocusEvent event) { log(event.getClass().getSimpleName()); } + @Override public void blur(BlurEvent event) { log(event.getClass().getSimpleName()); } diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java index 57a32aafc4..d8ae43fd6d 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java @@ -71,12 +71,14 @@ public abstract class AbstractComponentTestCase protected Command widthCommand = new Command() { + @Override public void execute(T t, String value, Object data) { t.setWidth(value); } }; protected Command heightCommand = new Command() { + @Override public void execute(T t, String value, Object data) { t.setHeight(value); } @@ -84,6 +86,7 @@ public abstract class AbstractComponentTestCase protected Command enabledCommand = new Command() { + @Override public void execute(T c, Boolean enabled, Object data) { c.setEnabled(enabled); } @@ -91,6 +94,7 @@ public abstract class AbstractComponentTestCase protected Command immediateCommand = new Command() { + @Override public void execute(T c, Boolean immediate, Object data) { c.setImmediate(immediate); } @@ -98,6 +102,7 @@ public abstract class AbstractComponentTestCase protected Command errorIndicatorCommand = new Command() { + @Override public void execute(T c, Boolean enabled, Object data) { if (enabled) { c.setComponentError(new UserError(errorMessage)); @@ -111,6 +116,7 @@ public abstract class AbstractComponentTestCase protected Command errorMessageCommand = new Command() { + @Override public void execute(T c, String value, Object data) { errorMessage = value; if (c.getComponentError() != null) { @@ -124,6 +130,7 @@ public abstract class AbstractComponentTestCase // TODO Move to AbstractFieldTestCase protected Command requiredCommand = new Command() { + @Override public void execute(T c, Boolean enabled, Object data) { if (c instanceof Field) { ((Field) c).setRequired(enabled); @@ -135,6 +142,7 @@ public abstract class AbstractComponentTestCase }; protected Command requiredErrorMessageCommand = new Command() { + @Override public void execute(T c, String value, Object data) { ((Field) c).setRequiredError(value); } @@ -142,6 +150,7 @@ public abstract class AbstractComponentTestCase }; protected Command descriptionCommand = new Command() { + @Override public void execute(T c, String value, Object data) { c.setDescription(value); } @@ -149,6 +158,7 @@ public abstract class AbstractComponentTestCase protected Command readonlyCommand = new Command() { + @Override public void execute(T c, Boolean enabled, Object data) { c.setReadOnly(enabled); } @@ -156,6 +166,7 @@ public abstract class AbstractComponentTestCase protected Command visibleCommand = new Command() { + @Override public void execute(T c, Boolean enabled, Object data) { c.setVisible(enabled); } @@ -163,6 +174,7 @@ public abstract class AbstractComponentTestCase protected Command iconCommand = new Command() { + @Override public void execute(T c, Resource value, Object data) { c.setIcon(value); } @@ -170,6 +182,7 @@ public abstract class AbstractComponentTestCase }; protected Command captionCommand = new Command() { + @Override public void execute(T c, String value, Object data) { c.setCaption(value); } @@ -178,6 +191,7 @@ public abstract class AbstractComponentTestCase protected Command localeCommand = new Command() { + @Override public void execute(T c, Locale value, Object data) { c.setLocale(value); } @@ -206,6 +220,7 @@ public abstract class AbstractComponentTestCase } protected Command styleNameCommand = new Command() { + @Override public void execute(T c, String value, Object data) { c.setStyleName(value); } diff --git a/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java b/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java index 5c25359e28..af62e5e4a4 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java @@ -15,6 +15,7 @@ public abstract class AbstractLayoutTest extends protected static final String CATEGORY_LAYOUT_FEATURES = "Layout features"; private Command marginCommand = new Command() { + @Override public void execute(T c, MarginInfo value, Object data) { c.setMargin(value); @@ -22,6 +23,7 @@ public abstract class AbstractLayoutTest extends }; protected Command spacingCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { ((SpacingHandler) c).setSpacing(value); } @@ -29,6 +31,7 @@ public abstract class AbstractLayoutTest extends private Command setComponentAlignment = new Command() { + @Override public void execute(T c, Integer value, Object alignment) { Component child = getComponentAtIndex(c, value); ((AlignmentHandler) c).setComponentAlignment(child, diff --git a/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java b/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java index fd323d2156..1d18cba952 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java @@ -12,6 +12,7 @@ public abstract class AbstractOrderedLayoutTest private Command layoutClickListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { c.addListener((LayoutClickListener) AbstractOrderedLayoutTest.this); @@ -24,6 +25,7 @@ public abstract class AbstractOrderedLayoutTest private Command setComponentExpandRatio = new Command() { + @Override public void execute(T c, Integer value, Object ratio) { Component child = getComponentAtIndex(c, value); c.setExpandRatio(child, (Float) ratio); @@ -74,6 +76,7 @@ public abstract class AbstractOrderedLayoutTest } + @Override public void layoutClick(LayoutClickEvent event) { log(event.getClass().getSimpleName() + ": button=" + event.getButtonName() + ", childComponent=" diff --git a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java index b458c12188..926af72a2f 100644 --- a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java +++ b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java @@ -26,6 +26,7 @@ public class AddRemoveSetStyleNamesTest extends TestBase { listener = new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { String style = (String) event.getButton().getData(); setComponentsStyle(style, !popupDateField.getStyleName() @@ -43,6 +44,7 @@ public class AddRemoveSetStyleNamesTest extends TestBase { button3 = new Button("Set thestyle", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { if (popupDateField.getStyleName().contains(thestyle)) { popupDateField.removeStyleName(thestyle); diff --git a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java index a2c186df7e..e949d62f71 100644 --- a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java +++ b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java @@ -114,6 +114,7 @@ public abstract class ComponentTestCase extends CheckBox checkBox = new CheckBox(caption); checkBox.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean enabled = (Boolean) event.getProperty().getValue(); doCommand(command, enabled); @@ -136,6 +137,7 @@ public abstract class ComponentTestCase extends Button button = new Button(caption); button.setData(Boolean.FALSE); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { Button b = event.getButton(); boolean state = (Boolean) b.getData(); @@ -163,6 +165,7 @@ public abstract class ComponentTestCase extends select.setNullSelectionAllowed(false); select.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { Object itemId = event.getProperty().getValue(); Item item = select.getItem(itemId); diff --git a/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java b/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java index 57b81ddecc..9fe13c457a 100644 --- a/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java +++ b/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java @@ -57,6 +57,7 @@ public class CustomComponentwithUndefinedSize extends TestBase { Button button = new Button("Change panel size", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { switch (step++ % 4) { case 0: diff --git a/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java b/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java index aa83ff7a42..cd284224a0 100644 --- a/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java +++ b/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java @@ -33,6 +33,7 @@ public class DisableEnableCascade extends TestBase { enableDisablePanelButton = new Button("Disable panel", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { enableDisable(outerPanel, enableDisablePanelButton); @@ -42,6 +43,7 @@ public class DisableEnableCascade extends TestBase { enableDisableTabSheetButton = new Button("Disable TabSheet", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { enableDisable(innerTabsheet, enableDisableTabSheetButton); @@ -52,6 +54,7 @@ public class DisableEnableCascade extends TestBase { enableDisableButtonButton = new Button("Disable Button", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { enableDisable(button, enableDisableButtonButton); diff --git a/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java b/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java index f3391afd1f..0279a92437 100644 --- a/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java +++ b/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java @@ -55,6 +55,7 @@ public class DisableEnableCascadeStyles extends TestBase { enableDisablePanelButton = new Button("Disable panel", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { enableDisable(outerPanel, enableDisablePanelButton); @@ -64,6 +65,7 @@ public class DisableEnableCascadeStyles extends TestBase { enableDisableTabSheetButton = new Button("Disable TabSheet", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { enableDisable(innerTabsheet, enableDisableTabSheetButton); @@ -74,6 +76,7 @@ public class DisableEnableCascadeStyles extends TestBase { enableDisableLayoutButton = new Button("Disable Tab content (Layout)", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { enableDisable(layout, enableDisableLayoutButton); @@ -82,6 +85,7 @@ public class DisableEnableCascadeStyles extends TestBase { enableDisableComponentsButton = new Button("Disable Layout Components", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { for (Iterator i = layout .getComponentIterator(); i.hasNext();) { diff --git a/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java index 267807b16b..7987c800f9 100644 --- a/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java +++ b/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java @@ -23,6 +23,7 @@ public class FocusAndBlurListeners extends TestBase { private FocusListener focusListener = new FocusListener() { + @Override public void focus(FocusEvent event) { Label msg = new Label(new Date() + " Focused " + event.getComponent().getCaption()); @@ -31,6 +32,7 @@ public class FocusAndBlurListeners extends TestBase { }; private BlurListener blurListener = new BlurListener() { + @Override public void blur(BlurEvent event) { Label msg = new Label(new Date() + " Blurred " + event.getComponent().getCaption()); @@ -74,6 +76,7 @@ public class FocusAndBlurListeners extends TestBase { private int i; + @Override public void buttonClick(ClickEvent event) { ogm.addItem("newItem" + i++); diff --git a/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java b/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java index 124f2b9cdf..cffc8ca27b 100644 --- a/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java +++ b/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java @@ -20,6 +20,7 @@ public class FocusFromShortcutAction extends TestBase { addComponent(select); addComponent(text); Button focusText = new Button("Focus text", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { text.focus(); } @@ -29,6 +30,7 @@ public class FocusFromShortcutAction extends TestBase { addComponent(focusText); Button focusSelect = new Button("Focus select", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { select.focus(); } diff --git a/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java b/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java index dc07c35f62..6e54c0d9f4 100644 --- a/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java +++ b/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java @@ -27,6 +27,7 @@ public class LayoutAttachListenerInfo extends TestBase { layouts.select("AbsoluteLayout"); layouts.setImmediate(true); layouts.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty().getValue().equals("AbsoluteLayout")) { testAbsoluteLayout(); @@ -64,6 +65,7 @@ public class LayoutAttachListenerInfo extends TestBase { a.setWidth("300px"); a.setHeight("300px"); a.addListener(new ComponentContainer.ComponentAttachListener() { + @Override public void componentAttachedToContainer(ComponentAttachEvent event) { AbsoluteLayout layout = (AbsoluteLayout) event.getContainer(); AbsoluteLayout.ComponentPosition position = layout @@ -78,6 +80,7 @@ public class LayoutAttachListenerInfo extends TestBase { content.addComponent(new Button("Attach label to layout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { a.addComponent(new Label("X"), "top:50px;left:50px"); } @@ -91,6 +94,7 @@ public class LayoutAttachListenerInfo extends TestBase { v.setWidth("300px"); v.setHeight("300px"); v.addListener(new ComponentContainer.ComponentAttachListener() { + @Override public void componentAttachedToContainer(ComponentAttachEvent event) { VerticalLayout layout = (VerticalLayout) event.getContainer(); getMainWindow().showNotification( @@ -104,6 +108,7 @@ public class LayoutAttachListenerInfo extends TestBase { content.addComponent(new Button("Attach label to layout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { v.addComponent(new Label("X")); @@ -118,6 +123,7 @@ public class LayoutAttachListenerInfo extends TestBase { g.setWidth("300px"); g.setHeight("300px"); g.addListener(new ComponentContainer.ComponentAttachListener() { + @Override public void componentAttachedToContainer(ComponentAttachEvent event) { GridLayout layout = (GridLayout) event.getContainer(); GridLayout.Area area = layout.getComponentArea(event @@ -133,6 +139,7 @@ public class LayoutAttachListenerInfo extends TestBase { content.addComponent(new Button("Attach label to layout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { g.addComponent(new Label("X"), 2, 3); } diff --git a/tests/testbench/com/vaadin/tests/components/TouchScrollables.java b/tests/testbench/com/vaadin/tests/components/TouchScrollables.java index 8ad12da85f..0cef24f437 100644 --- a/tests/testbench/com/vaadin/tests/components/TouchScrollables.java +++ b/tests/testbench/com/vaadin/tests/components/TouchScrollables.java @@ -79,12 +79,14 @@ public class TouchScrollables extends TestBase { final Label l = l50; Button button = new Button("Scroll to label 50", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { getLayout().getRoot().scrollIntoView(l); } }); cssLayout.addComponent(button); button = new Button("Scroll to 100px", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { p.setScrollTop(100); } @@ -117,6 +119,7 @@ public class TouchScrollables extends TestBase { Button button = new Button("Toggle lazyloading"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { if (table.getCacheRate() == 100) { table.setCacheRate(2); @@ -131,6 +134,7 @@ public class TouchScrollables extends TestBase { button = new Button("Toggle selectable"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { table.setSelectable(!table.isSelectable()); } @@ -159,6 +163,7 @@ public class TouchScrollables extends TestBase { private Component getSubWindowTest() { Button b = new Button("Open subwindow", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { Window w = new Window("Subwindow"); w.center(); @@ -185,10 +190,12 @@ public class TouchScrollables extends TestBase { Action[] actions = new Action[] { new Action("FOO"), new Action("BAR"), new Action("CAR") }; + @Override public Action[] getActions(Object target, Object sender) { return actions; } + @Override public void handleAction(Action action, Object sender, Object target) { Notification.show(action.getCaption()); @@ -206,10 +213,12 @@ public class TouchScrollables extends TestBase { // accept only drags from this table AcceptCriterion crit = new SourceIs(table); + @Override public AcceptCriterion getAcceptCriterion() { return crit; } + @Override public void drop(DragAndDropEvent dropEvent) { AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dropEvent .getTargetDetails(); diff --git a/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java b/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java index 139ed5bb0b..826b7cee07 100644 --- a/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java +++ b/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java @@ -22,6 +22,7 @@ public class MoveComponentsFromAbsoluteLayoutToInnerLayout extends TestBase { testButton = new Button("Click to move to inner layout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { vl.addComponent(testButton); } @@ -37,6 +38,7 @@ public class MoveComponentsFromAbsoluteLayoutToInnerLayout extends TestBase { Button b = new Button("Repaint inner layout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { vl.requestRepaint(); } diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java index 9261962b0d..f8931ecdea 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java @@ -20,6 +20,7 @@ public class EnableState extends AbstractTestCase { CheckBox enable = new CheckBox("Toggle button enabled", true); enable.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean enabled = (Boolean) event.getProperty().getValue(); button.setEnabled(enabled); @@ -31,6 +32,7 @@ public class EnableState extends AbstractTestCase { CheckBox caption = new CheckBox("Toggle button caption", true); caption.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { button.setCaption(button.getCaption() + "+"); } @@ -40,6 +42,7 @@ public class EnableState extends AbstractTestCase { CheckBox visible = new CheckBox("Toggle panel visibility", true); visible.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean visible = (Boolean) event.getProperty().getValue(); @@ -51,6 +54,7 @@ public class EnableState extends AbstractTestCase { CheckBox panelEnable = new CheckBox("Toggle panel enabled", true); panelEnable.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean enabled = (Boolean) event.getProperty().getValue(); panel.setEnabled(enabled); diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java index c009e1d7bc..300abe1851 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java @@ -57,6 +57,7 @@ public class TooltipTests extends TestBase { private final Property.ValueChangeListener panelListener = new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean value = (Boolean) (event.getProperty().getValue()); if (value) { @@ -70,6 +71,7 @@ public class TooltipTests extends TestBase { private final Property.ValueChangeListener layoutListener = new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean value = (Boolean) (event.getProperty().getValue()); if (value) { @@ -83,6 +85,7 @@ public class TooltipTests extends TestBase { private final Property.ValueChangeListener labelListener = new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean value = (Boolean) (event.getProperty().getValue()); if (value) { diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java index 93ba858e37..9b29ae1bab 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java @@ -45,6 +45,7 @@ public abstract class AbstractComponentDataBindingTest extends TestBase cb.setImmediate(true); cb.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { updateLocale((Locale) localeSelect.getValue()); } @@ -91,6 +92,7 @@ public abstract class AbstractComponentDataBindingTest extends TestBase return null; } + @Override public void valueChange(ValueChangeEvent event) { AbstractField field = (AbstractField) event.getProperty(); // if (field == localeSelect) { diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java index 5d0e0fe488..aa630c79fd 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java @@ -33,6 +33,7 @@ public class AbstractFieldCommitWithInvalidValues extends TestBase { Button b = new Button("Commit", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { tf.commit(); diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java index 780130847a..f1b96d24fd 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java @@ -34,6 +34,7 @@ public class AbstractFieldDataSourceReadOnly extends TestBase { // Button Button button = new Button("Make data source read-only"); button.addListener(new Listener() { + @Override public void componentEvent(Event event) { stateHolder.buttonClicked(); } diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java index 716f80e23f..66b5e23cda 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java @@ -65,6 +65,7 @@ public abstract class AbstractFieldTest> extends .addItem("AbstractField", null); abstractField.addItem("Show value", new MenuBar.Command() { + @Override public void menuSelected(MenuItem selectedItem) { for (T a : getTestComponents()) { log(a.getClass().getSimpleName() + " value: " @@ -101,6 +102,7 @@ public abstract class AbstractFieldTest> extends protected Command valueChangeListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { c.addListener((ValueChangeListener) AbstractFieldTest.this); @@ -111,6 +113,7 @@ public abstract class AbstractFieldTest> extends }; protected Command readonlyStatusChangeListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { c.addListener((ReadOnlyStatusChangeListener) AbstractFieldTest.this); @@ -122,11 +125,13 @@ public abstract class AbstractFieldTest> extends protected Command setValueCommand = new Command() { + @Override public void execute(T c, Object value, Object data) { c.setValue(value); } }; + @Override public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { log(event.getClass().getSimpleName() + ", new value: " + getValue(event.getProperty())); @@ -168,6 +173,7 @@ public abstract class AbstractFieldTest> extends } + @Override public void readOnlyStatusChange(ReadOnlyStatusChangeEvent event) { log(event.getClass().getSimpleName()); } diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java index b68134f379..1f407c710f 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java @@ -14,12 +14,14 @@ public abstract class AbstractTextFieldTest private Command maxlengthCommand = new Command() { + @Override public void execute(T c, Integer value, Object data) { c.setMaxLength(value); } }; private Command nullSelectionAllowedCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { c.setNullSettingAllowed(value); @@ -27,18 +29,21 @@ public abstract class AbstractTextFieldTest }; private Command nullRepresentationCommand = new Command() { + @Override public void execute(T c, String value, Object data) { c.setNullRepresentation(value); } }; private Command inputPromptCommand = new Command() { + @Override public void execute(T c, String value, Object data) { c.setInputPrompt(value); } }; private Command textChangeListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { c.addListener((TextChangeListener) AbstractTextFieldTest.this); @@ -49,24 +54,28 @@ public abstract class AbstractTextFieldTest }; private Command colsCommand = new Command() { + @Override public void execute(T c, Integer value, Object data) { c.setColumns(value); } }; private Command textChangeEventModeCommand = new Command() { + @Override public void execute(T c, TextChangeEventMode value, Object data) { c.setTextChangeEventMode(value); } }; private Command textChangeTimeoutCommand = new Command() { + @Override public void execute(T c, Integer value, Object data) { c.setTextChangeTimeout(value); } }; private Command selectionRangeCommand = new Command() { + @Override public void execute(T c, Range value, Object data) { c.setSelectionRange(value.getStart(), value.getEnd() - value.getStart()); @@ -74,6 +83,7 @@ public abstract class AbstractTextFieldTest } }; private Command selectAllCommand = new Command() { + @Override public void execute(T c, Object value, Object data) { c.selectAll(); } @@ -81,6 +91,7 @@ public abstract class AbstractTextFieldTest private Command setCursorPositionCommand = new Command() { + @Override public void execute(T c, Integer value, Object data) { c.setCursorPosition(value); } @@ -230,6 +241,7 @@ public abstract class AbstractTextFieldTest } + @Override public void textChange(TextChangeEvent event) { AbstractTextField tf = (AbstractTextField) event.getComponent(); log("TextChangeEvent: text='" + event.getText() + "', cursor position=" diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java index deea0fbe0a..aa8c7ff778 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java @@ -24,6 +24,7 @@ public class DateFieldBasedOnLong extends AbstractComponentDataBindingTest { addComponent(new Button("Set property value to 10000L", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { property.setValue(10000L); diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java index c13aadd895..01fcb02b77 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java @@ -34,6 +34,7 @@ public class IntegerDoubleFieldsWithDataSource extends TestBase { tf.setImmediate(true); tf.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { try { log.log("Value for " + tf.getCaption() + " changed to " diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java index b25dc9d953..929247fc80 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java @@ -29,6 +29,7 @@ public class IntegerFieldWithoutDataSource extends TestBase { tf.setImmediate(true); tf.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { try { log.log("Value for " + tf.getCaption() + " changed to " diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java b/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java index 26720d67f3..309e297374 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java @@ -20,6 +20,7 @@ public class ShortcutAddAndRemove extends TestBase { final Button logButton = new Button("Log a row (enter shortcut)"); logButton.setClickShortcut(KeyCode.ENTER); logButton.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { log.log("Log button was clicked"); } @@ -27,6 +28,7 @@ public class ShortcutAddAndRemove extends TestBase { final Button removeShortcut = new Button("Remove shortcut"); removeShortcut.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { logButton.removeClickShortcut(); logButton.setCaption("Log a row (no shortcut)"); @@ -34,6 +36,7 @@ public class ShortcutAddAndRemove extends TestBase { }); final Button addShortcut = new Button("Add shortcut"); addShortcut.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { logButton.setClickShortcut(KeyCode.ENTER); logButton.setCaption("Log a row (enter shortcut)"); diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java index 8ce214918d..fc08a4505c 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java @@ -31,6 +31,7 @@ public class TextFieldConversions extends AbstractComponentDataBindingTest { dataType.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { tf.setPropertyDataSource(new ObjectProperty(o, (Class) dataType.getValue())); @@ -42,6 +43,7 @@ public class TextFieldConversions extends AbstractComponentDataBindingTest { addComponent(tf); tf.setErrorHandler(new ComponentErrorHandler() { + @Override public boolean handleComponentError(ComponentErrorEvent event) { tf.setComponentError(new UserError("Invalid value")); return true; diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java index 0228a59f06..a9aa4d2a43 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java @@ -7,6 +7,7 @@ import com.vaadin.data.util.converter.Converter; public class Vaadin6ImplicitDoubleConverter implements Converter { + @Override public Double convertToModel(String value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { if (null == value) { @@ -15,6 +16,7 @@ public class Vaadin6ImplicitDoubleConverter implements return new Double(value.toString()); } + @Override public String convertToPresentation(Double value, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { if (value == null) { @@ -24,10 +26,12 @@ public class Vaadin6ImplicitDoubleConverter implements } + @Override public Class getModelType() { return Double.class; } + @Override public Class getPresentationType() { return String.class; } diff --git a/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java b/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java index a048cf04a8..d24def22dd 100644 --- a/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java +++ b/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java @@ -47,6 +47,7 @@ public class RemoveTabs extends TestBase { closeCurrent = new Button("Close current tab"); closeCurrent.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { closeCurrentTab(); @@ -55,6 +56,7 @@ public class RemoveTabs extends TestBase { closeFirst = new Button("close first tab"); closeFirst.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { closeFirstTab(); @@ -63,6 +65,7 @@ public class RemoveTabs extends TestBase { closeLast = new Button("close last tab"); closeLast.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { closeLastTab(); @@ -71,6 +74,7 @@ public class RemoveTabs extends TestBase { reorderTabs = new Button("reorder"); reorderTabs.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { reorder(); diff --git a/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java b/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java index f613a8b14f..605ab676b6 100644 --- a/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java +++ b/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java @@ -29,6 +29,7 @@ public class BeanItemContainerNullValues extends TestBase { Button b = new Button("Disable sorting", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { table.setSortEnabled(!table.isSortEnabled()); if (table.isSortEnabled()) { diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java b/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java index 7efd40ca5d..0d4981a441 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java @@ -17,10 +17,12 @@ public class ButtonEnterWithWindowShortcut extends TestBase { getMainWindow().addActionHandler(new Handler() { private static final long serialVersionUID = -4976129418325394913L; + @Override public void handleAction(Action action, Object sender, Object target) { log.log(action.getCaption() + " pressed in window"); } + @Override public Action[] getActions(Object target, Object sender) { ShortcutAction enter = new ShortcutAction("enter", ShortcutAction.KeyCode.ENTER, null); @@ -32,6 +34,7 @@ public class ButtonEnterWithWindowShortcut extends TestBase { Button button = new Button("Focus me and press enter", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { log.log("button click listener fired"); } diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java b/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java index aca85d4efe..b27f948669 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java @@ -11,6 +11,7 @@ public class ButtonErrorMessage extends TestBase { protected void setup() { Button b = new Button("Click for error"); b.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { throw new NullPointerException(); } diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java index 253de5b43c..5cdc34e8e8 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java @@ -19,6 +19,7 @@ public class ButtonHtml extends TestBase { final Button swapButton = new Button("Swap button"); swapButton.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { swapButton.setHtmlContentAllowed(!swapButton .isHtmlContentAllowed()); diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java index 8fe56b7619..2e60c7cfcc 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java @@ -14,6 +14,7 @@ public class ButtonMouseDetails extends TestBase { private Button.ClickListener clickListener = new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { StringBuilder str = new StringBuilder(out.getValue().toString()); str.append(clickCounter + ":\t"); diff --git a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java index e04d50bddb..7526e7dbc3 100644 --- a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java +++ b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java @@ -13,6 +13,7 @@ public class Buttons2 extends AbstractComponentTest private Command disableOnClickCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { c.setDisableOnClick(value); } @@ -20,6 +21,7 @@ public class Buttons2 extends AbstractComponentTest private Command clickListenerCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { if (value) { c.addListener((Button.ClickListener) Buttons2.this); @@ -62,6 +64,7 @@ public class Buttons2 extends AbstractComponentTest } + @Override public void buttonClick(ClickEvent event) { log(event.getClass().getSimpleName()); } diff --git a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java index 295c04fc0c..4fb8df678e 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java +++ b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java @@ -60,6 +60,7 @@ public class ShortCutListenerModification extends TestBase implements } + @Override public void buttonClick(ClickEvent event) { Component c = event.getButton(); while (!(c instanceof Window)) { diff --git a/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java b/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java index 4952b4bc50..c1f1846415 100644 --- a/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java +++ b/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java @@ -27,6 +27,7 @@ public class TooltipForDisabledButton extends TestBase { buttonDisabled.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { getMainWindow().showNotification("Clicked Disabled"); } @@ -35,6 +36,7 @@ public class TooltipForDisabledButton extends TestBase { buttonEnabled.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { getMainWindow().showNotification("Clicked Enabled"); } diff --git a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java index 3211a9c142..cbdde63df0 100644 --- a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java +++ b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java @@ -47,6 +47,7 @@ public class IconsInCaption extends TestBase { iconTypeSelect.setImmediate(true); iconTypeSelect.setNullSelectionAllowed(false); iconTypeSelect.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { updateContainer(); } @@ -60,6 +61,7 @@ public class IconsInCaption extends TestBase { containerSelect.setImmediate(true); containerSelect.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { updateContainer(); diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java index 2c981432c8..28abf5172d 100644 --- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java +++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java @@ -29,6 +29,7 @@ public class CheckBoxNullValue extends TestBase { final Button button = new Button("Validate"); addComponent(button); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { checkbox.setComponentError(null); requiredCheckbox.setComponentError(null); diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java index 4f9cd10ecc..6734c752de 100644 --- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java +++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java @@ -19,6 +19,7 @@ public class CheckBoxes2 extends AbstractFieldTest implements } + @Override public void buttonClick(ClickEvent event) { log(event.getClass().getSimpleName()); } diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java index 88a403b1b6..38bdf0c5fe 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java @@ -29,6 +29,7 @@ public class ComboBoxCombinedWithEnterShortcut extends TestBase { aButton.setClickShortcut(KeyCode.ENTER); aButton.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { log.log("Button clicked. ComboBox value: " + l.getValue()); diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java index 9285983b99..a475c86ca0 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java @@ -57,6 +57,7 @@ public class ComboBoxDataSourceChange extends TestBase { Button b = new Button("Use ds1"); b.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cb2.setContainerDataSource(ds1); currentDS.setValue("ds1"); @@ -72,6 +73,7 @@ public class ComboBoxDataSourceChange extends TestBase { b = new Button("Use ds2"); b.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cb2.setContainerDataSource(ds2); currentDS.setValue("ds2"); @@ -82,6 +84,7 @@ public class ComboBoxDataSourceChange extends TestBase { addComponent(hl); cb2.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { currentValue.setValue(event.getProperty().getValue()); } diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java index d9739602f6..c5e411678d 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java @@ -16,6 +16,7 @@ public class ComboBoxEnablesComboBox extends TestBase { populate(cb); cb.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { cb2.setEnabled(true); } diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java index fd434a7acd..5f33b96a73 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java @@ -27,6 +27,7 @@ public class ComboBoxIdenticalItems extends TestBase { select.addListener(new Property.ValueChangeListener() { private static final long serialVersionUID = -7932700771673919620L; + @Override public void valueChange(ValueChangeEvent event) { log.log("Item " + select.getValue() + " selected"); diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java index 70aad31364..c0490c127d 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java @@ -17,6 +17,7 @@ public class ComboBoxInPopup extends TestBase { w.addComponent(createComboBox()); Button close = new Button("Close window", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { w.close(); } diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java index e11b10f3e1..0afa1e887e 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java @@ -24,6 +24,7 @@ public class ComboBoxInvalidNullSelection extends TestBase { Button b = new Button("Swap data source"); b.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { if (combo.getContainerDataSource() == ds1) { combo.setContainerDataSource(ds2); @@ -39,6 +40,7 @@ public class ComboBoxInvalidNullSelection extends TestBase { combo.setContainerDataSource(ds1); combo.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { log.log("Value is now: " + combo.getValue()); } diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java index c78ff7675f..5dc5a2efbd 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java @@ -58,6 +58,7 @@ public class ComboBoxReapperingOldValue extends Application.LegacyApplication return container; } + @Override public void valueChange(ValueChangeEvent event) { cbox2.removeAllItems(); if ("1".equals(event.getProperty().getValue().toString())) { diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java index 15742cc783..0336ff423b 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java @@ -45,6 +45,7 @@ public class ComboBoxSlow extends TestBase { } cb.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { log.log("Value changed to " + cb.getValue()); diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java index 5c1dad4a30..d98997d28f 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java @@ -24,6 +24,7 @@ public class ComboBoxSlowInFF extends TestBase { Button fill = new Button("fill it"); fill.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { t.removeAllItems(); for (int i = 0; i < 200; i++) { diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java index 09354fdacf..24aea18314 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java @@ -16,6 +16,7 @@ public class ComboBoxSuggestionOnDetach extends TestBase { ComboBox comboBox = new ComboBox("Combo box", Arrays.asList("Option 1", "Option 2", "Option 3")); comboBox.addListener(new FieldEvents.FocusListener() { + @Override public void focus(FocusEvent event) { popup.close(); } diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java index 6f6e550ab4..d33a858dc8 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java @@ -17,6 +17,7 @@ public class ComboBoxTextFieldEventOrder extends TestBase { final Select select = new Select("select", Arrays.asList("1", "2", "3", "4")); textField.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { select.addItem(Long.valueOf(select.size() + 1).toString()); // or // just diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java index b8f7a9758d..76ee83384e 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java @@ -29,6 +29,7 @@ public class ComboBoxValueUpdate extends TestBase { select.addListener(new ComboBox.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { System.err .println("Selected " + event.getProperty().getValue()); diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java index 8befbb4612..3071ab4c2d 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java @@ -10,12 +10,14 @@ import com.vaadin.ui.Select; public class ComboBoxes2 extends SelectTest { private Command inputPromptCommand = new Command() { + @Override public void execute(ComboBox c, String value, Object data) { c.setInputPrompt(value); } }; private Command filteringModeCommand = new Command() { + @Override public void execute(ComboBox c, Integer value, Object data) { c.setFilteringMode(value); } @@ -39,6 +41,7 @@ public class ComboBoxes2 extends SelectTest { private void createTextInputAlowedAction(String category) { createBooleanAction("Text input allowed", category, true, new Command() { + @Override public void execute(ComboBox c, Boolean value, Object data) { c.setTextInputAllowed(value.booleanValue()); } @@ -48,6 +51,7 @@ public class ComboBoxes2 extends SelectTest { private void createNewItemsAllowedAction(String category) { createBooleanAction("New items allowed", category, false, new Command() { + @Override public void execute(ComboBox c, Boolean value, Object data) { c.setNewItemsAllowed(value.booleanValue()); } @@ -80,6 +84,7 @@ public class ComboBoxes2 extends SelectTest { createSelectAction("Icon", category, createIconOptions(false), "-", new Command() { + @Override public void execute(ComboBox c, Resource value, Object data) { for (Object id : c.getItemIds()) { if (value == null) { diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java index 44285f97c2..ef390007be 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java @@ -34,6 +34,7 @@ public class ComboFocusBlurEvents extends TestBase { final ObjectProperty log = new ObjectProperty(""); cb.addListener(new FieldEvents.FocusListener() { + @Override public void focus(FocusEvent event) { log.setValue(log.getValue().toString() + "
    " + counter + ": Focus event!"); @@ -42,6 +43,7 @@ public class ComboFocusBlurEvents extends TestBase { }); cb.addListener(new FieldEvents.BlurListener() { + @Override public void blur(BlurEvent event) { log.setValue(log.getValue().toString() + "
    " + counter + ": Blur event!"); diff --git a/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java b/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java index 94ab20df43..5b1af58421 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java @@ -136,6 +136,7 @@ public class Comboboxes extends ComponentTestCase { return createSelectAction("Icon", options, "", new Command() { + @Override public void execute(ComboBox c, String value, Object data) { for (Object id : c.getItemIds()) { if (value == null) { diff --git a/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java b/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java index d93db563e3..00e9242a7a 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java @@ -17,6 +17,7 @@ public class NewItemsESCPress extends TestBase { final ComboBox box = new ComboBox("New items are allowed"); box.setNewItemsAllowed(true); box.setNewItemHandler(new NewItemHandler() { + @Override public void addNewItem(String newItemCaption) { String value = (String) addedItems.getValue(); addedItems.setValue(value + newItemCaption + "\n"); diff --git a/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java b/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java index a79b85ece4..ce6a24d9bd 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java @@ -22,6 +22,7 @@ public class RemovalOfSelectedIcon extends TestBase { btClear.setImmediate(true); btClear.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { cb2.removeAllItems(); cb2.setContainerDataSource(null); diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java b/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java index 22fc381c72..9ca5a58487 100644 --- a/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java +++ b/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java @@ -24,6 +24,7 @@ public class ClipContent extends TestBase { final TextField w = new TextField("Width"); w.setValue("20px"); w.addListener(new TextField.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { cc.setWidth(w.getValue()); } @@ -32,6 +33,7 @@ public class ClipContent extends TestBase { final TextField h = new TextField("Height"); h.setValue("20px"); h.addListener(new TextField.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { cc.setHeight(h.getValue()); } diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java index 9a559f7414..4311ad1f08 100644 --- a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java +++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java @@ -24,6 +24,7 @@ public class CustomComponentGrowingContent extends TestBase { }); addComponent(new Button("Set long content", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { label.setValue("Longer content that should be fully visible"); } diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java index 43d4c70eb8..2351b02e2a 100644 --- a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java +++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java @@ -20,6 +20,7 @@ public class CustomComponentSizeUpdate extends TestBase { nb.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { cc.setWidth((cc.getWidth() - 20) + "px"); cc.setHeight((cc.getHeight() - 20) + "px"); diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java index 2dc3063b0c..28e4dfb385 100644 --- a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java +++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java @@ -54,6 +54,7 @@ public class CustomLayoutUsingTemplate extends TestBase implements return null; } + @Override public void buttonClick(ClickEvent event) { layout.addComponent(new TextField("A text field!"), "location2"); } diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java index 6ea1d0a0c5..06dd39ac38 100644 --- a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java +++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java @@ -28,6 +28,7 @@ public class CustomLayoutUsingTheme extends TestBase implements ClickListener { VerticalLayout menu = new VerticalLayout(); menu.addComponent(new Button("Set body to label", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { layout.addComponent(new Label(LoremIpsum.get(200)), "body"); } @@ -35,6 +36,7 @@ public class CustomLayoutUsingTheme extends TestBase implements ClickListener { menu.addComponent(new Button("Set body to huge NativeButton", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { layout.addComponent(new NativeButton( "This is it, the body!"), "body"); @@ -53,6 +55,7 @@ public class CustomLayoutUsingTheme extends TestBase implements ClickListener { return null; } + @Override public void buttonClick(ClickEvent event) { layout.addComponent(new TextField("A text field!"), "location2"); } diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java index c15ca1916a..07c740a96d 100644 --- a/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java +++ b/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java @@ -52,6 +52,7 @@ public abstract class AbstractNestedFormExample extends TestBase { private Property.ValueChangeListener getTableValueChangeListener() { return new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { if (personForm != null) { removeComponent(personForm); diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java index 02c080e8fd..693b1e11b1 100644 --- a/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java +++ b/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java @@ -21,6 +21,7 @@ public class AddressFormExample extends TestBase { addComponent(field); Button commitButton = new Button("Save", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { field.commit(); Address address = field.getValue(); diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java index dc60d7e517..409ecccca8 100644 --- a/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java +++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java @@ -23,6 +23,7 @@ public class BooleanField extends CustomField { final Button button = new Button("Click me"); button.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { Object value = getValue(); boolean newValue = true; diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java index 88c6f7fc45..a52b168e84 100644 --- a/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java +++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java @@ -61,6 +61,7 @@ public class BooleanFieldExample extends TestBase { layout.addComponent(form); Button submit = new Button("Submit", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { form.commit(); Notification.show("The custom boolean field value is " diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java index e0a3b08bc7..0bc4f45545 100644 --- a/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java +++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java @@ -48,6 +48,7 @@ public class NestedPersonForm extends Form { buttons.setSpacing(true); Button discardChanges = new Button("Discard changes", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { NestedPersonForm.this.discard(); } @@ -56,6 +57,7 @@ public class NestedPersonForm extends Form { buttons.setComponentAlignment(discardChanges, Alignment.MIDDLE_LEFT); Button apply = new Button("Apply", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { NestedPersonForm.this.commit(); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java index 1395b4d735..c4f001ac41 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java @@ -72,6 +72,7 @@ public class CommitInvalid extends TestBase { Button validate = new Button("Validate"); validate.setDebugId("_validate"); validate.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { form.validate(); @@ -88,6 +89,7 @@ public class CommitInvalid extends TestBase { Button commit = new Button("Commit"); commit.setDebugId("_commit"); commit.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { form.commit(); @@ -103,6 +105,7 @@ public class CommitInvalid extends TestBase { form.getFooter().addComponent(commit); Button printState = new Button("printState"); printState.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { printState(); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java index 48bf3622d1..acca47ee5e 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java @@ -37,6 +37,7 @@ public class CustomDateFormats extends TestBase { s.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { setDateFieldLocale((Locale) s.getValue()); } @@ -155,6 +156,7 @@ public class CustomDateFormats extends TestBase { df.setValue(cal.getTime()); df.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { updateServerSideLabel((DateField) event.getProperty()); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java index dac3169b18..1d5554ac3e 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java @@ -48,6 +48,7 @@ public class DateFieldEmptyValid extends TestBase { df.setImmediate(true); df.setResolution(DateField.RESOLUTION_DAY); df.addListener(new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { log.log("Value changeEvent"); checkEmpty(); @@ -59,6 +60,7 @@ public class DateFieldEmptyValid extends TestBase { b.setDebugId("clear"); b.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { log.log("Clearing date aka setValue(null)"); df.setValue(null); @@ -70,6 +72,7 @@ public class DateFieldEmptyValid extends TestBase { b.setDebugId("set4.5.1990"); b.addListener(new ClickListener() { + @Override @SuppressWarnings("deprecation") public void buttonClick(ClickEvent event) { log.log("Setting new value to datefield (4.5.1990)"); @@ -81,6 +84,7 @@ public class DateFieldEmptyValid extends TestBase { b = new Button("Set date to 5.6.2000 using a property data source"); b.addListener(new ClickListener() { + @Override @SuppressWarnings("deprecation") public void buttonClick(ClickEvent event) { log.log("Setting new object property (5.6.2000) to datefield"); @@ -97,6 +101,7 @@ public class DateFieldEmptyValid extends TestBase { b.setDebugId("set-via-ds"); b.addListener(new ClickListener() { + @Override @SuppressWarnings("deprecation") public void buttonClick(ClickEvent event) { log.log("Setting object property (with value null) to datefield and set value of property to 27.8.2005"); @@ -111,6 +116,7 @@ public class DateFieldEmptyValid extends TestBase { b = new Button("Check value"); b.setDebugId("check-value"); b.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { log.log("Checking state"); checkEmpty(); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java index 298359068e..2a7807670b 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java @@ -106,6 +106,7 @@ public class DateFieldInSubWindow extends AbstractTestCase { Button b = new Button("Close", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { TestCaseWindow.this.close(); } @@ -122,6 +123,7 @@ public class DateFieldInSubWindow extends AbstractTestCase { LegacyWindow mainWindow = new LegacyWindow(); setMainWindow(mainWindow); Button open = new Button("Open window", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { getMainWindow().addWindow(new TestCaseWindow()); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java index dd61ccd60c..5d06895d11 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java @@ -21,6 +21,7 @@ public class DateFieldLocale extends TestBase { addComponent(new Button("Change locale", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { if (dateField.getLocale().getCountry().equalsIgnoreCase("fi")) { dateField.setLocale(new Locale("zh", "CN")); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java index e7c3442060..1a3b3858b8 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java @@ -39,6 +39,7 @@ public class DateFieldMinResolution extends TestBase { idf.setImmediate(true); idf.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { lbl.setValue(dformat.format(event.getProperty().getValue())); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java index bf93d8c8b9..befdd65693 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java @@ -56,6 +56,7 @@ public class DateFieldRangeValidation extends TestBase { private Range range = new Range(); private ValueChangeListener refreshField = new ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { actualDateField.requestRepaint(); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java index 516d207a38..392dbaf9c6 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java @@ -43,6 +43,7 @@ public class DateFieldReadOnly extends TestBase { Button b = new Button("Switch read-only"); b.addListener(new ClickListener() { + @Override public void buttonClick(ClickEvent event) { timeField.setReadOnly(!timeField.isReadOnly()); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java index e8c8b69f9f..c502b9597e 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java @@ -21,6 +21,7 @@ public class DateFieldTest extends AbstractFieldTest { private Command setValue = new Command() { + @Override public void execute(T c, Date value, Object data) { c.setValue(value); } @@ -109,6 +110,7 @@ public class DateFieldTest extends AbstractFieldTest { private Command resolutionCommand = new Command() { + @Override public void execute(T c, Resolution value, Object data) { c.setResolution(value); @@ -116,6 +118,7 @@ public class DateFieldTest extends AbstractFieldTest { }; private Command lenientCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { c.setLenient(false); @@ -123,6 +126,7 @@ public class DateFieldTest extends AbstractFieldTest { }; private Command weekNumberCommand = new Command() { + @Override public void execute(T c, Boolean value, Object data) { c.setShowISOWeekNumbers(value); @@ -130,6 +134,7 @@ public class DateFieldTest extends AbstractFieldTest { }; private Command dateFormatCommand = new Command() { + @Override public void execute(T c, String value, Object data) { c.setDateFormat(value); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java index 340b647931..6f31b4d80f 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java @@ -51,6 +51,7 @@ public class DateFieldTimezone extends TestBase { timezoneSelector.setNullSelectionItemId(nullValue); timezoneSelector.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS); timezoneSelector.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { Object value = event.getProperty().getValue(); TimeZone timeZone; @@ -75,6 +76,7 @@ public class DateFieldTimezone extends TestBase { dateField.setTimeZone(cal.getTimeZone()); dateField.setLocale(EN); dateField.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { Date date = dateField.getValue(); DateFormat format = DateFormat.getDateTimeInstance( diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java index 9b4a3c3383..bbe2423a3f 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java @@ -15,6 +15,7 @@ public class DateFieldUnparsableDate extends TestBase { public MyDateField(String caption) { super(caption); addListener(new Property.ValueChangeListener() { + @Override public void valueChange( com.vaadin.data.Property.ValueChangeEvent event) { oldDate = getValue(); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java b/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java index 060c7fcc0a..b5842694f0 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java @@ -15,6 +15,7 @@ public class DefaultHandleUnparsableDateField extends TestBase { date.setImmediate(true); addComponent(date); date.addListener(new Property.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { if (date.isValid()) { getMainWindow() diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java b/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java index 8f201e120d..4e256aa947 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java @@ -16,6 +16,7 @@ public class DisabledDateFieldWidth extends TestBase { Button button = new Button("Repaint datefield", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { dateField1.requestRepaint(); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java index b8c5be57bf..c642db1bc0 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java @@ -81,6 +81,7 @@ public class InlineDateFields extends ComponentTestCase { return createSelectAction("Resolution", options, "Year", new Command() { + @Override public void execute(InlineDateField c, Resolution value, Object data) { c.setResolution(value); @@ -97,6 +98,7 @@ public class InlineDateFields extends ComponentTestCase { return createSelectAction("Locale", options, LOCALES[0].toString(), new Command() { + @Override public void execute(InlineDateField c, Locale value, Object data) { c.setCaption(c.getCaption().replaceAll( diff --git a/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java b/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java index cbe9ac613f..585395d747 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java @@ -73,6 +73,7 @@ public class LenientMode extends TestBase implements ValueChangeListener { } + @Override public void valueChange(ValueChangeEvent event) { getMainWindow().showNotification( "New value" + event.getProperty().getValue()); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java b/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java index 1c1994cbe5..9c2d3d7d51 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java @@ -16,6 +16,7 @@ public class LowResolution extends TestBase { dateField.setValue(new java.util.Date()); dateField.setResolution(PopupDateField.RESOLUTION_MONTH); dateField.addListener(new PopupDateField.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { getMainWindow().showNotification( "Date now" + event.getProperty()); @@ -28,6 +29,7 @@ public class LowResolution extends TestBase { // dateField.setValue(new java.util.Date()); dateField3.setResolution(PopupDateField.RESOLUTION_YEAR); dateField3.addListener(new PopupDateField.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { getMainWindow().showNotification( "Date now" + event.getProperty()); @@ -40,6 +42,7 @@ public class LowResolution extends TestBase { dateField2.setValue(new java.util.Date()); dateField2.setResolution(PopupDateField.RESOLUTION_MONTH); dateField2.addListener(new PopupDateField.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { getMainWindow().showNotification( "Date now" + event.getProperty()); @@ -52,6 +55,7 @@ public class LowResolution extends TestBase { "Immediate (use sync button to change fields) "); immediate.setValue(true); immediate.addListener(new CheckBox.ValueChangeListener() { + @Override public void valueChange(ValueChangeEvent event) { boolean immediate = !dateField.isImmediate(); dateField.setImmediate(immediate); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java index 357c61f4f6..a12bdfa44c 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java @@ -41,6 +41,7 @@ public class PopupDateFieldExtendedRange extends TestBase { } addComponent(new Button("Change date", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { date.set(2010, 1, 16); for (PopupDateField f : fields) { diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java index 3ab1f52891..3e8b0678a7 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java @@ -27,6 +27,7 @@ public class PopupDateFieldTest extends DateFieldTest { createSelectAction("Input prompt", category, options, "", new Command() { + @Override public void execute(PopupDateField c, String value, Object data) { c.setInputPrompt(value); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java index ad961ee7a6..bf2a679c63 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java @@ -77,6 +77,7 @@ public class PopupDateFields extends ComponentTestCase { return createSelectAction("Resolution", options, "Year", new Command() { + @Override public void execute(PopupDateField c, Resolution value, Object data) { c.setResolution(value); @@ -94,6 +95,7 @@ public class PopupDateFields extends ComponentTestCase { return createSelectAction("Input prompt", options, "", new Command() { + @Override public void execute(PopupDateField c, String value, Object data) { c.setInputPrompt(value); diff --git a/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java b/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java index 6686fa6fe0..da8f45690c 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java @@ -28,6 +28,7 @@ public class ShowSelectedDateAfterInvalid extends TestBase { Button button = new Button("Validate"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(Button.ClickEvent event) { form.setValidationVisible(true); if (form.isValid()) { diff --git a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java index 578c4df903..403590f609 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java @@ -44,6 +44,7 @@ public class ValueThroughProperty extends TestBase { cal.set(Calendar.DAY_OF_MONTH, 14); Button setDateButton1 = new Button( "Set value to 12/14/10 using property", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { dateProperty.setValue(cal.getTime()); } @@ -53,6 +54,7 @@ public class ValueThroughProperty extends TestBase { Button setDateButton2 = new Button( "Set value to 12/14/10 using setValue", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { df.setValue(cal.getTime()); } diff --git a/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java b/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java index 88542751c3..b7b0f50947 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java @@ -20,12 +20,14 @@ public class WidthRecalculationOnEnableStateChange extends TestBase { addComponent(df); addComponent(new Button("Toggle disabled for date field", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { df.setEnabled(!df.isEnabled()); } })); addComponent(new Button("Toggle read only for date field", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { df.setReadOnly(!df.isReadOnly()); } diff --git a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java index 6b89d1392c..aeb0864707 100644 --- a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java +++ b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java @@ -80,10 +80,12 @@ public class DragAndDropWrapperTooltips extends TestBase { private DropHandler dh = new DropHandler() { + @Override public AcceptCriterion getAcceptCriterion() { return AcceptAll.get(); } + @Override public void drop(DragAndDropEvent dropEvent) { Transferable transferable = dropEvent.getTransferable(); if (transferable instanceof TransferableImpl) { diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java index f8874810fc..9a412cee9d 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java @@ -38,6 +38,7 @@ public class EmbeddedAltText extends TestBase { Button changeAltTexts = new Button("Change alt texts", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { e.setAlternateText("New alt text of the image!"); player.setAlternateText("New alt text of the object!"); diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java index 96b1d36901..c9b6991d8f 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java @@ -14,6 +14,7 @@ public class EmbeddedClickListenerRelativeCoordinates extends TestBase { "../runo/icons/64/ok.png")); e.addListener(new ClickListener() { + @Override public void click(ClickEvent event) { getMainWindow() .showNotification( diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java index 1a5327c8b9..e316fcc5ec 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java @@ -45,6 +45,7 @@ public class EmbeddedImageRefresh extends TestBase { // The button requests repainting the embedded. Button button = new Button("refr"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { embedded.requestRepaint(); } @@ -52,6 +53,7 @@ public class EmbeddedImageRefresh extends TestBase { addComponent(button); button = new Button("refr name"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { ((StreamResource) embedded.getSource()).setFilename(new Date() .getTime() + ".png"); @@ -61,6 +63,7 @@ public class EmbeddedImageRefresh extends TestBase { addComponent(button); button = new Button("200x200"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { embedded.setWidth("200px"); embedded.setHeight("200px"); @@ -69,6 +72,7 @@ public class EmbeddedImageRefresh extends TestBase { addComponent(button); button = new Button("undef"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { embedded.setSizeUndefined(); } @@ -85,6 +89,7 @@ public class EmbeddedImageRefresh extends TestBase { return (int) Math.round(pos * resolution / (cells * 1.0)); } + @Override public InputStream getStream() { // Create an image and draw some background on it. BufferedImage image = new BufferedImage(640, 480, diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java index d507cebebc..c3854d2420 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java @@ -29,6 +29,7 @@ public class EmbeddedPdf extends TestBase { addComponent(player); addComponent(new Button("Remove pdf", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { removeComponent(player); } diff --git a/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java b/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java index 5255b97ffa..539263a363 100644 --- a/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java +++ b/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java @@ -42,6 +42,7 @@ public class FormClearDatasourceRepaint extends TestBase { addComponent(form); addComponent(new Button("Clear datasource", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { form.setItemDataSource(null); } @@ -49,6 +50,7 @@ public class FormClearDatasourceRepaint extends TestBase { addComponent(new Button("Change data source", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { form.setItemDataSource(new BeanItem( new MyBean())); diff --git a/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java b/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java index 6bc7cb5cca..907b8a27f3 100644 --- a/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java +++ b/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java @@ -34,6 +34,7 @@ public class FormCommitWithInvalidValues extends TestBase { Button b = new Button("Commit", new ClickListener() { + @Override public void buttonClick(ClickEvent event) { try { form.commit(); diff --git a/tests/testbench/com/vaadin/tests/components/form/FormDescription.java b/tests/testbench/com/vaadin/tests/components/form/FormDescription.java index 63369413f6..76ea039756 100644 --- a/tests/testbench/com/vaadin/tests/components/form/FormDescription.java +++ b/tests/testbench/com/vaadin/tests/components/form/FormDescription.java @@ -17,6 +17,7 @@ public class FormDescription extends TestBase { addComponent(new Button("Toggle description", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { if (form.getDescription() == null) { form.setDescription("Form description"); diff --git a/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java b/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java index ecf3215005..41e1a91781 100644 --- a/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java +++ b/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java @@ -49,6 +49,7 @@ public class FormRenderingFlicker extends TestBase { table.setImmediate(true); table.addListener(new ItemClickListener() { + @Override public void itemClick(ItemClickEvent event) { clicked(event.getItem()); } diff --git a/tests/testbench/com/vaadin/tests/components/form/FormTest.java b/tests/testbench/com/vaadin/tests/components/form/FormTest.java index 451a1b7fa3..ec7ba2e03c 100644 --- a/tests/testbench/com/vaadin/tests/components/form/FormTest.java +++ b/tests/testbench/com/vaadin/tests/components/form/FormTest.java @@ -30,6 +30,7 @@ public class FormTest extends AbstractFieldTest
    { private Command footerWidthCommand = new Command() { + @Override public void execute(Form c, String value, Object data) { Layout footer = c.getFooter(); if (footer != null) { @@ -40,6 +41,7 @@ public class FormTest extends AbstractFieldTest { }; private Command footerHeightCommand = new Command() { + @Override public void execute(Form c, String value, Object data) { Layout footer = c.getFooter(); if (footer != null) { @@ -51,6 +53,7 @@ public class FormTest extends AbstractFieldTest { private Command> formLayoutCommand = new Command>() { + @Override public void execute(Form c, Class value, Object data) { if (value == null) { c.setLayout(null); @@ -73,6 +76,7 @@ public class FormTest extends AbstractFieldTest { }; private Command> formFooterCommand = new Command>() { + @Override public void execute(Form c, Class value, Object data) { if (value == null) { c.setFooter(null); @@ -92,6 +96,7 @@ public class FormTest extends AbstractFieldTest { }; private Command formItemDataSourceCommand = new Command() { + @Override public void execute(Form c, Item value, Object data) { c.setItemDataSource(value); } @@ -148,6 +153,7 @@ public class FormTest extends AbstractFieldTest { options.put("Default", DefaultFieldFactory.get()); options.put("Custom FieldFactory", new FormFieldFactory() { + @Override public Field createField(Item item, Object propertyId, Component uiContext) { Class type = item.getItemProperty(propertyId).getType(); @@ -186,6 +192,7 @@ public class FormTest extends AbstractFieldTest { Command formFactoryCommand = new Command() { + @Override public void execute(Form c, FormFieldFactory value, Object data) { c.setFormFieldFactory(value); c.setItemDataSource(c.getItemDataSource()); @@ -227,6 +234,7 @@ public class FormTest extends AbstractFieldTest { } Command footerComponentAlignmentCommand = new Command() { + @Override public void execute(Form c, Alignment value, Object data) { Layout l = c.getFooter(); if (l instanceof AlignmentHandler) { diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java index 689ba7ea83..ed1a3d9bd9 100644 --- a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java +++ b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java @@ -20,6 +20,7 @@ public class FormWithEnterShortCut extends TestBase { Button button = new Button("Go"); button.addListener(new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { log.log("search: " + tf.getValue()); } diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java b/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java index b803f8667f..24d207739e 100644 --- a/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java +++ b/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java @@ -18,6 +18,7 @@ public class FormWithPropertyFormatterConnected extends TestBase { Form form2 = new Form(); form2.setFormFieldFactory(new FormFieldFactory() { + @Override public Field createField(Item item, Object propertyId, Component uiContext) { AbstractField f = (AbstractField) DefaultFieldFactory.get() diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java index e74969f637..0055c3782e 100644 --- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java +++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java @@ -20,6 +20,7 @@ public class FormLayoutCaptionStyles extends TestBase { fl.addComponent(new Button("Toggle Text field 2 bold style", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { if ("bold".equals(f2.getStyleName())) { f2.setStyleName(""); diff --git a/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java b/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java index 648bbd2d52..165827eb6b 100644 --- a/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java +++ b/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java @@ -45,6 +45,7 @@ public class GridLayoutInForm extends TestBase { addComponent(new Button("Use 15 first fields", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { form.setVisibleItemProperties(propertyIds .subList(0, 15)); @@ -52,6 +53,7 @@ public class GridLayoutInForm extends TestBase { })); addComponent(new Button("Use 15 last fields", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { form.setVisibleItemProperties(propertyIds.subList(35, 50)); @@ -59,6 +61,7 @@ public class GridLayoutInForm extends TestBase { })); addComponent(new Button("Use all fields", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { form.setVisibleItemProperties(propertyIds); } diff --git a/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java b/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java index da0efe9464..1c10b1d9d7 100644 --- a/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java +++ b/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java @@ -22,6 +22,7 @@ public class MoveComponentsFromGridLayoutToInnerLayout extends TestBase { testButton = new Button("Click to move to inner layout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { vl.addComponent(testButton); } @@ -37,6 +38,7 @@ public class MoveComponentsFromGridLayoutToInnerLayout extends TestBase { Button b = new Button("Repaint inner layout", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { vl.requestRepaint(); } diff --git a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index a7430705f5..d2ab0787da 100644 --- a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -42,17 +42,20 @@ public class BasicJavaScriptComponent extends AbstractTestRoot { public class ExampleWidget extends AbstractJavaScriptComponent { public ExampleWidget() { registerRpc(new TestRpc() { + @Override public void sendRpc(String message) { log.log("Got RPC message: " + message); } }); registerCallback("messageToServer", new JavaScriptCallback() { + @Override public void call(JSONArray arguments) throws JSONException { log.log("Got callback message: " + arguments.getString(0)); } }); registerCallback("reportParentIds", new JavaScriptCallback() { + @Override public void call(JSONArray arguments) throws JSONException { JSONArray parentIds = arguments.getJSONArray(0); if (!parentIds.getString(0).equals(getConnectorId())) { diff --git a/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java b/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java index a5bb291b67..61caf9a2f2 100644 --- a/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java +++ b/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java @@ -27,6 +27,7 @@ public class HundredPercentWideLabelResize extends TestBase { getLayout().addComponent( new Button("toggle width", new Button.ClickListener() { + @Override public void buttonClick(ClickEvent event) { if (getLayout().getWidth() == 500) { getLayout().setWidth("100px"); diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelTest.java b/tests/testbench/com/vaadin/tests/components/label/LabelTest.java index 6547e7a20f..17c3dc8402 100644 --- a/tests/testbench/com/vaadin/tests/components/label/LabelTest.java +++ b/tests/testbench/com/vaadin/tests/components/label/LabelTest.java @@ -14,12 +14,14 @@ public class LabelTest extends AbstractComponentTest