diff options
author | John Ahlroos <john@vaadin.com> | 2012-09-27 13:42:32 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-09-27 13:42:32 +0300 |
commit | 93d0f638a144d7fb62fe7cc1f5943bff98b3c49c (patch) | |
tree | 5be2fcad9af1e8b7b66785ec46198302449c8028 | |
parent | e9346c969a73a6a949285e257fa231c00c43d4d7 (diff) | |
parent | f242a6a77439e6b12d920727070d556a6b96fb13 (diff) | |
download | vaadin-framework-93d0f638a144d7fb62fe7cc1f5943bff98b3c49c.tar.gz vaadin-framework-93d0f638a144d7fb62fe7cc1f5943bff98b3c49c.zip |
Merge branch 'master' into primary-stylename
22 files changed, 151 insertions, 135 deletions
diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index 96c1b0e014..e6d8272ab3 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -107,7 +107,7 @@ } var initialPath = getConfig("initialPath"); - if (initialPath === null) { + if (initialPath !== undefined) { url += '&initialPath=' + encodeURIComponent(initialPath); } url += '&initialParams=' + encodeURIComponent(JSON.stringify(getConfig("initialParams"))); diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 6112e5ba1c..67eaba0cca 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -14,6 +14,11 @@ <param-value>false</param-value> <description>Vaadin production mode</description> </context-param> + + <context-param> + <param-name>resourceCacheTime</param-name> + <param-value>3600</param-value> + </context-param> <servlet> <servlet-name>Embed App 1</servlet-name> <servlet-class>com.vaadin.server.LegacyVaadinServlet</servlet-class> @@ -43,11 +48,6 @@ </init-param> </servlet> - <context-param> - <param-name>resourceCacheTime</param-name> - <param-value>3600</param-value> - </context-param> - <servlet> <servlet-name>VaadinApplicationRunner</servlet-name> <servlet-class>com.vaadin.launcher.ApplicationRunnerServlet</servlet-class> diff --git a/WebContent/release-notes.html b/WebContent/release-notes.html index 63449514d9..cefd29f665 100644 --- a/WebContent/release-notes.html +++ b/WebContent/release-notes.html @@ -111,41 +111,16 @@ server-side components integrated with client-side widgets. </p> - <h2 id="enhancements">Enhancements in Vaadin @version-minor@</h2> + <h2 id="enhancements">Enhancements in Vaadin @version@</h2> <p> - @version-minor@ is the first beta release release of the upcoming Version 7 of the - Vaadin Framework. It introduces the final major set of new features in Vaadin 7, - for the purpose of receiving feedback about the changes. + @version@ is a beta release release of the upcoming version 7 of the + Vaadin Framework. It introduces some minor changes, minor new features and fixes. </p> - <p>The major new changes in this first beta release are:</p> - - <ul> - <li>Applications are now written by extending the <b>UI</b> class - <ul> - <li>UIs use heartbeat to detect closing</li> - </ul> - </li> - <li>The <b>Application</b> class is removed altogether - <ul> - <li><b>ApplicationServlet</b> is replaced with <b>VaadinServlet</b></li> - <li><b>ApplicationResource</b> is replaced with <b>ConnectorResource</b></li> - </ul> - </li> - <li>Themeing with <a href="http://sass-lang.com/">SASS</a> in addition to CSS - <ul> - <li>SASS themes need to (and CSS themes can) be compiled to a single CSS stylesheet with the <tt>vaadin-theme-compiler</tt></li> - </ul> - </li> - <li>Add-ons can modify the startup page</i></li> - <li>All <tt>addListener()</tt> methods have changed to listener-specific methods, such as <tt>addClickListener()</tt>, <tt>addValueChangeListener()</tt>, etc.</li> - <li>Packaging has changed, now in a ZIP package (see <a href="package">Package Contents</a> above) - </li> - </ul> - <p> - The following major changes were first introduced in the alpha releases: + The following major changes were introduced in the earlier + @version-minor@ releases: </p> <ul> @@ -185,6 +160,29 @@ <li><b>Form</b> is deprecated and form hand is replaced with the <b>FieldGroup</b></li> <li>Get computed style of a component from the browser</li> <li>Support for border, padding, and margin in core layout components</li> + <ul> + <li>Applications are now written by extending the <b>UI</b> class + <ul> + <li>UIs use heartbeat to detect closing</li> + </ul> + </li> + <li>The <b>Application</b> class is removed altogether + <ul> + <li><b>ApplicationServlet</b> is replaced with <b>VaadinServlet</b></li> + <li><b>ApplicationResource</b> is replaced with <b>ConnectorResource</b></li> + </ul> + </li> + <li>Themeing with <a href="http://sass-lang.com/">SASS</a> in addition to CSS + <ul> + <li>SASS themes need to (and CSS themes can) be compiled to a single CSS stylesheet with the <tt>vaadin-theme-compiler</tt></li> + </ul> + </li> + <li>Add-ons can modify the startup page</i></li> + <li>All <tt>addListener()</tt> methods have changed to listener-specific methods, such as <tt>addClickListener()</tt>, <tt>addValueChangeListener()</tt>, etc.</li> + <li>Packaging has changed, now in a ZIP package (see <a href="package">Package Contents</a> above) + </li> + </ul> + </ul> <p> @@ -198,8 +196,10 @@ href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.alpha1/release-notes.html">alpha1</a>, <a href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.alpha2/release-notes.html">alpha2</a>, + <a + href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.alpha3/release-notes.html">alpha3</a>, and <a - href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.alpha3/release-notes.html">alpha3</a> + href="http://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.beta1/release-notes.html">beta1</a> for the lists of where the major enhancements were introduced. </p> @@ -207,7 +207,7 @@ <p> For a complete list of changes in this release, please see the <a - href="http://dev.vaadin.com/query?status=closed&group=resolution&milestone=Vaadin+7.0.0.beta1">list + href="http://dev.vaadin.com/query?status=closed&group=resolution&milestone=Vaadin+@version@">list of closed tickets</a>. </p> @@ -270,7 +270,7 @@ <h3>Upgrading the Eclipse Plugin</h3> - <p> + <p> This release requires that you use the <i>experimental</i> Vaadin Plugin for Eclipse. Its update site is <tt>http://vaadin.com/eclipse/experimental</tt>. Please see the <a diff --git a/server/src/com/vaadin/server/AddonContext.java b/server/src/com/vaadin/server/AddonContext.java index 513d56150b..0e147e4fcd 100644 --- a/server/src/com/vaadin/server/AddonContext.java +++ b/server/src/com/vaadin/server/AddonContext.java @@ -55,10 +55,10 @@ public class AddonContext implements Serializable { public AddonContext(VaadinService vaadinService) { this.vaadinService = vaadinService; vaadinService - .addVaadinSessionInitializationListener(new VaadinSessionInitializationListener() { + .addSessionInitListener(new SessionInitListener() { @Override - public void vaadinSessionInitialized( - VaadinSessionInitializeEvent event) + public void sessionInit( + SessionInitEvent event) throws ServiceException { for (BootstrapListener l : bootstrapListeners) { event.getSession().addBootstrapListener(l); diff --git a/server/src/com/vaadin/server/DefaultUIProvider.java b/server/src/com/vaadin/server/DefaultUIProvider.java index 7769747906..4c44bec058 100644 --- a/server/src/com/vaadin/server/DefaultUIProvider.java +++ b/server/src/com/vaadin/server/DefaultUIProvider.java @@ -24,12 +24,6 @@ public class DefaultUIProvider extends UIProvider { public Class<? extends UI> getUIClass(UIClassSelectionEvent event) { VaadinRequest request = event.getRequest(); - // Only use UI from web.xml for requests to the root - String pathInfo = request.getRequestPathInfo(); - if (pathInfo != null && !"/".equals(pathInfo)) { - return null; - } - Object uiClassNameObj = request.getService() .getDeploymentConfiguration().getInitParameters() .getProperty(VaadinSession.UI_PARAMETER); diff --git a/server/src/com/vaadin/server/LegacyVaadinPortlet.java b/server/src/com/vaadin/server/LegacyVaadinPortlet.java index a91a82076e..067cd6266f 100644 --- a/server/src/com/vaadin/server/LegacyVaadinPortlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinPortlet.java @@ -48,11 +48,11 @@ public class LegacyVaadinPortlet extends VaadinPortlet { public void init(PortletConfig portletConfig) throws PortletException { super.init(portletConfig); - getService().addVaadinSessionInitializationListener( - new VaadinSessionInitializationListener() { + getService().addSessionInitListener( + new SessionInitListener() { @Override - public void vaadinSessionInitialized( - VaadinSessionInitializeEvent event) + public void sessionInit( + SessionInitEvent event) throws ServiceException { try { onVaadinSessionStarted(VaadinPortletRequest diff --git a/server/src/com/vaadin/server/LegacyVaadinServlet.java b/server/src/com/vaadin/server/LegacyVaadinServlet.java index 1209ca8419..097ab02a6a 100644 --- a/server/src/com/vaadin/server/LegacyVaadinServlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinServlet.java @@ -49,11 +49,11 @@ public class LegacyVaadinServlet extends VaadinServlet { public void init(ServletConfig servletConfig) throws ServletException { super.init(servletConfig); - getService().addVaadinSessionInitializationListener( - new VaadinSessionInitializationListener() { + getService().addSessionInitListener( + new SessionInitListener() { @Override - public void vaadinSessionInitialized( - VaadinSessionInitializeEvent event) + public void sessionInit( + SessionInitEvent event) throws ServiceException { try { onVaadinSessionStarted(event.getRequest(), diff --git a/server/src/com/vaadin/server/VaadinSessionDestroyEvent.java b/server/src/com/vaadin/server/SessionDestroyEvent.java index 9dc877863f..a482a6d7b0 100644 --- a/server/src/com/vaadin/server/VaadinSessionDestroyEvent.java +++ b/server/src/com/vaadin/server/SessionDestroyEvent.java @@ -21,12 +21,12 @@ import java.util.EventObject; /** * Event fired when a Vaadin session is no longer in use. * - * @see VaadinSessionDestroyListener#vaadinSessionDestroyed(VaadinSessionDestroyEvent) + * @see SessionDestroyListener#sessionDestroy(SessionDestroyEvent) * * @author Vaadin Ltd * @since 7.0.0 */ -public class VaadinSessionDestroyEvent extends EventObject { +public class SessionDestroyEvent extends EventObject { private final VaadinSession session; @@ -38,8 +38,7 @@ public class VaadinSessionDestroyEvent extends EventObject { * @param session * the Vaadin session that is no longer used */ - public VaadinSessionDestroyEvent(VaadinService service, - VaadinSession session) { + public SessionDestroyEvent(VaadinService service, VaadinSession session) { super(service); this.session = session; } diff --git a/server/src/com/vaadin/server/VaadinSessionDestroyListener.java b/server/src/com/vaadin/server/SessionDestroyListener.java index 3f516c1eda..a174f3718a 100644 --- a/server/src/com/vaadin/server/VaadinSessionDestroyListener.java +++ b/server/src/com/vaadin/server/SessionDestroyListener.java @@ -19,17 +19,17 @@ package com.vaadin.server; /** * A listener that gets notified when a Vaadin session is no longer used. * - * @see VaadinService#addVaadinSessionDestroyListener(VaadinSessionDestroyListener) + * @see VaadinService#addSessionDestroyListener(SessionDestroyListener) * * @author Vaadin Ltd * @since 7.0.0 */ -public interface VaadinSessionDestroyListener { +public interface SessionDestroyListener { /** * Called when a Vaadin session is no longer used. * * @param event * the event with details about the destroyed session */ - public void vaadinSessionDestroyed(VaadinSessionDestroyEvent event); + public void sessionDestroy(SessionDestroyEvent event); } diff --git a/server/src/com/vaadin/server/VaadinSessionInitializeEvent.java b/server/src/com/vaadin/server/SessionInitEvent.java index a05b40a7dc..34272d06ad 100644 --- a/server/src/com/vaadin/server/VaadinSessionInitializeEvent.java +++ b/server/src/com/vaadin/server/SessionInitEvent.java @@ -27,12 +27,12 @@ import java.util.EventObject; * only when the first request for that session is handled by a specific * service. * - * @see VaadinSessionInitializationListener#vaadinSessionInitialized(VaadinSessionInitializeEvent) + * @see SessionInitListener#sessionInit(SessionInitEvent) * * @author Vaadin Ltd * @since 7.0.0 */ -public class VaadinSessionInitializeEvent extends EventObject { +public class SessionInitEvent extends EventObject { private final VaadinSession session; private final VaadinRequest request; @@ -47,8 +47,8 @@ public class VaadinSessionInitializeEvent extends EventObject { * @param request * the request that triggered the initialization */ - public VaadinSessionInitializeEvent(VaadinService service, - VaadinSession session, VaadinRequest request) { + public SessionInitEvent(VaadinService service, VaadinSession session, + VaadinRequest request) { super(service); this.session = session; this.request = request; diff --git a/server/src/com/vaadin/server/VaadinSessionInitializationListener.java b/server/src/com/vaadin/server/SessionInitListener.java index c4722b9a86..b34cf9b095 100644 --- a/server/src/com/vaadin/server/VaadinSessionInitializationListener.java +++ b/server/src/com/vaadin/server/SessionInitListener.java @@ -27,12 +27,12 @@ import java.io.Serializable; * but only when the first request for that session is handled by a specific * service. * - * @see VaadinService#addVaadinSessionInitializationListener(VaadinSessionInitializationListener) + * @see VaadinService#addSessionInitListener(SessionInitListener) * * @author Vaadin Ltd * @since 7.0.0 */ -public interface VaadinSessionInitializationListener extends Serializable { +public interface SessionInitListener extends Serializable { /** * Invoked when a new Vaadin session is initialized for that service. * <p> @@ -46,6 +46,6 @@ public interface VaadinSessionInitializationListener extends Serializable { * @throws ServiceException * a problem occurs when processing the event */ - public void vaadinSessionInitialized(VaadinSessionInitializeEvent event) + public void sessionInit(SessionInitEvent event) throws ServiceException; } diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index 2c0331c65e..b99d4d2e55 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -59,7 +59,7 @@ public abstract class VaadinService implements Serializable { * * @author Vaadin Ltd */ - public static class VaadinServiceData { + public static class VaadinServiceData implements Serializable { private final VaadinService vaadinService; private LinkedList<UIProvider> uiProviders = new LinkedList<UIProvider>(); @@ -117,12 +117,11 @@ public abstract class VaadinService implements Serializable { } private static final Method SESSION_INIT_METHOD = ReflectTools.findMethod( - VaadinSessionInitializationListener.class, - "vaadinSessionInitialized", VaadinSessionInitializeEvent.class); + SessionInitListener.class, "sessionInit", SessionInitEvent.class); private static final Method SESSION_DESTROY_METHOD = ReflectTools - .findMethod(VaadinSessionDestroyListener.class, - "vaadinSessionDestroyed", VaadinSessionDestroyEvent.class); + .findMethod(SessionDestroyListener.class, "sessionDestroy", + SessionDestroyEvent.class); /** * @deprecated Only supported for {@link LegacyApplication}. @@ -299,44 +298,41 @@ public abstract class VaadinService implements Serializable { * created but only when the first request for that session is handled by * this service. * - * @see #removeVaadinSessionInitializationListener(VaadinSessionInitializationListener) - * @see VaadinSessionInitializationListener + * @see #removeSessionInitListener(SessionInitListener) + * @see SessionInitListener * * @param listener * the vaadin session initialization listener */ - public void addVaadinSessionInitializationListener( - VaadinSessionInitializationListener listener) { - eventRouter.addListener(VaadinSessionInitializeEvent.class, listener, + public void addSessionInitListener(SessionInitListener listener) { + eventRouter.addListener(SessionInitEvent.class, listener, SESSION_INIT_METHOD); } /** * Removes a Vaadin session initialization listener from this service. * - * @see #addVaadinSessionInitializationListener(VaadinSessionInitializationListener) + * @see #addSessionInitListener(SessionInitListener) * * @param listener * the Vaadin session initialization listener to remove. */ - public void removeVaadinSessionInitializationListener( - VaadinSessionInitializationListener listener) { - eventRouter.removeListener(VaadinSessionInitializeEvent.class, - listener, SESSION_INIT_METHOD); + public void removeSessionInitListener(SessionInitListener listener) { + eventRouter.removeListener(SessionInitEvent.class, listener, + SESSION_INIT_METHOD); } /** * Adds a listener that gets notified when a Vaadin session that has been * initialized for this service is destroyed. * - * @see #addVaadinSessionInitializationListener(VaadinSessionInitializationListener) + * @see #addSessionInitListener(SessionInitListener) * * @param listener * the vaadin session destroy listener */ - public void addVaadinSessionDestroyListener( - VaadinSessionDestroyListener listener) { - eventRouter.addListener(VaadinSessionDestroyEvent.class, listener, + public void addSessionDestroyListener(SessionDestroyListener listener) { + eventRouter.addListener(SessionDestroyEvent.class, listener, SESSION_DESTROY_METHOD); } @@ -345,21 +341,19 @@ public abstract class VaadinService implements Serializable { vaadinSession.cleanupUI(ui); } - eventRouter - .fireEvent(new VaadinSessionDestroyEvent(this, vaadinSession)); + eventRouter.fireEvent(new SessionDestroyEvent(this, vaadinSession)); } /** * Removes a Vaadin session destroy listener from this service. * - * @see #addVaadinSessionDestroyListener(VaadinSessionDestroyListener) + * @see #addSessionDestroyListener(SessionDestroyListener) * * @param listener * the vaadin session destroy listener */ - public void removeVaadinSessionDestroyListener( - VaadinSessionDestroyListener listener) { - eventRouter.removeListener(VaadinSessionDestroyEvent.class, listener, + public void removeSessionDestroyListener(SessionDestroyListener listener) { + eventRouter.removeListener(SessionDestroyEvent.class, listener, SESSION_DESTROY_METHOD); } @@ -508,8 +502,7 @@ public abstract class VaadinService implements Serializable { private void onVaadinSessionStarted(VaadinRequest request, VaadinSession session) throws ServiceException { - eventRouter.fireEvent(new VaadinSessionInitializeEvent(this, session, - request)); + eventRouter.fireEvent(new SessionInitEvent(this, session, request)); ServletPortletHelper.checkUiProviders(session, this); } @@ -719,6 +712,7 @@ public abstract class VaadinService implements Serializable { * typically checks the @{@link PreserveOnRefresh} annotation but UI * providers and ultimately VaadinService implementations may choose to * override the defaults. + * * @param provider * the UI provider responsible for the UI * @param event diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index 269080a59c..1883910b7b 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -39,8 +39,8 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.server.VaadinServletRequest; import com.vaadin.server.VaadinServletService; import com.vaadin.server.VaadinSession; -import com.vaadin.server.VaadinSessionInitializationListener; -import com.vaadin.server.VaadinSessionInitializeEvent; +import com.vaadin.server.SessionInitListener; +import com.vaadin.server.SessionInitEvent; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.UI; @@ -76,11 +76,11 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet { @Override protected void servletInitialized() { super.servletInitialized(); - getService().addVaadinSessionInitializationListener( - new VaadinSessionInitializationListener() { + getService().addSessionInitListener( + new SessionInitListener() { @Override - public void vaadinSessionInitialized( - VaadinSessionInitializeEvent event) + public void sessionInit( + SessionInitEvent event) throws ServiceException { onVaadinSessionStarted(event.getRequest(), event.getSession()); diff --git a/uitest/src/com/vaadin/tests/components/ui/TestUITheme.java b/uitest/src/com/vaadin/tests/components/ui/TestUITheme.java index 1a5db630b3..bfed424483 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TestUITheme.java +++ b/uitest/src/com/vaadin/tests/components/ui/TestUITheme.java @@ -10,14 +10,14 @@ public class TestUITheme extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - Label label = new Label("A red label"); - label.setStyleName("red"); + Label label = new Label("A green label"); + label.setStyleName("green"); addComponent(label); } @Override public String getTestDescription() { - return "UI with @Theme(\"tests-tickets\")"; + return "UI with @Theme(\"tests-tickets\"). The label uses a stylename that should only be defined in the test-tickets theme."; } @Override diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java index 061eb7a23e..fd4dfaced6 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java @@ -28,10 +28,10 @@ public class ComponentInStateComponent extends AbstractComponent { } public void setOtherComponent(Component component) { - getState().setOtherComponent(component); + getState().otherComponent = component; } public Component getOtherComponent() { - return (Component) getState().getOtherComponent(); + return (Component) getState().otherComponent; } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java index 292ac62125..365d4b9951 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java @@ -50,10 +50,10 @@ public class MyComponent extends AbstractComponent { } public void setText(String text) { - getState().setText(text); + getState().text = text; } public String getText() { - return getState().getText(); + return getState().text; } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java new file mode 100644 index 0000000000..ad4139d883 --- /dev/null +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java @@ -0,0 +1,47 @@ +package com.vaadin.tests.minitutorials.v7a3; + +import org.json.JSONArray; +import org.json.JSONException; + +import com.vaadin.server.ExternalResource; +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.JavaScript; +import com.vaadin.ui.JavaScriptFunction; +import com.vaadin.ui.Link; +import com.vaadin.ui.Notification; +import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.UI; + +public class JSAPIUI extends UI { + @Override + public void init(VaadinRequest request) { + + JavaScript.getCurrent().addFunction("com.example.api.notify", + new JavaScriptFunction() { + @Override + public void call(JSONArray arguments) throws JSONException { + try { + String caption = arguments.getString(0); + if (arguments.length() == 1) { + // only caption + Notification.show(caption); + } else { + // type should be in [1] + Notification.show(caption, + Type.values()[arguments.getInt(1)]); + } + + } catch (JSONException e) { + // We'll log in the console, you might not want to + JavaScript.getCurrent().execute( + "console.error('" + e.getMessage() + "')"); + } + } + }); + + addComponent(new Link( + "Send message", + new ExternalResource( + "javascript:(function(){com.example.api.notify(prompt('Message'),2);})();"))); + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java index 63947c2435..b64d0f0ad5 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java @@ -20,13 +20,5 @@ import com.vaadin.shared.ComponentState; import com.vaadin.shared.Connector; public class ComponentInStateState extends ComponentState { - private Connector otherComponent; - - public Connector getOtherComponent() { - return otherComponent; - } - - public void setOtherComponent(Connector otherComponent) { - this.otherComponent = otherComponent; - } + public Connector otherComponent; } diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java index 35469e7501..dcb8bae89c 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java @@ -35,7 +35,7 @@ public class ComponentInStateStateConnector extends AbstractComponentConnector { } public ComponentConnector getOtherComponent() { - return (ComponentConnector) getState().getOtherComponent(); + return (ComponentConnector) getState().otherComponent; } @Override diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java index c80a4c88f0..4745457c1f 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java @@ -46,7 +46,7 @@ public class MyComponentConnector extends AbstractComponentConnector { public void onStateChanged(StateChangeEvent stateChangeEvent) { super.onStateChanged(stateChangeEvent); - final String text = getState().getText(); + final String text = getState().text; getWidget().setText(text); } diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java index 8b68331f30..948f98e756 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java @@ -4,14 +4,6 @@ import com.vaadin.shared.ComponentState; public class MyComponentState extends ComponentState { - private String text; - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } + public String text; }
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java index fc65f6b2ae..68af02d6ce 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java @@ -2,8 +2,6 @@ package com.vaadin.tests.widgetset.client.minitutorials.v7a2; import java.util.List; -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorHierarchyChangeEvent; import com.vaadin.client.ui.AbstractComponentContainerConnector; @@ -17,7 +15,7 @@ public class WidgetContainerConnector extends @Override public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) { List<ComponentConnector> children = getChildComponents(); - VWidgetContainer widget = (VWidgetContainer) getWidget(); + VWidgetContainer widget = getWidget(); widget.clear(); for (ComponentConnector connector : children) { widget.add(connector.getWidget()); @@ -26,8 +24,8 @@ public class WidgetContainerConnector extends } @Override - protected Widget createWidget() { - return GWT.create(VWidgetContainer.class); + public VWidgetContainer getWidget() { + return (VWidgetContainer) super.getWidget(); } @Override |