diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-11-23 11:38:20 +0200 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-11-23 11:38:20 +0200 |
commit | e78cfa7e6ca953e0ecd030cfffb760425a1293bc (patch) | |
tree | 55b2fe56e8cc6e9dbe5569be3c9597b69052ebcb /server | |
parent | 1647984d05c5c576c1fe343111c826f3b6c71bc3 (diff) | |
download | vaadin-framework-e78cfa7e6ca953e0ecd030cfffb760425a1293bc.tar.gz vaadin-framework-e78cfa7e6ca953e0ecd030cfffb760425a1293bc.zip |
Refactor Extension API (#10337)
Change-Id: Ib16ffceb8dce235b59848c55e59407074e7d5bda
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/server/AbstractExtension.java | 7 | ||||
-rw-r--r-- | server/src/com/vaadin/server/Extension.java | 8 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/JavaScript.java | 2 |
3 files changed, 8 insertions, 9 deletions
diff --git a/server/src/com/vaadin/server/AbstractExtension.java b/server/src/com/vaadin/server/AbstractExtension.java index 747caee967..19c904163e 100644 --- a/server/src/com/vaadin/server/AbstractExtension.java +++ b/server/src/com/vaadin/server/AbstractExtension.java @@ -55,11 +55,8 @@ public abstract class AbstractExtension extends AbstractClientConnector target.addExtension(this); } - /** - * Remove this extension from its target. After an extension has been - * removed, it can not be attached again. - */ - public void removeFromTarget() { + @Override + public void remove() { getParent().removeExtension(this); } diff --git a/server/src/com/vaadin/server/Extension.java b/server/src/com/vaadin/server/Extension.java index bb7d133e8e..1bb61ab96e 100644 --- a/server/src/com/vaadin/server/Extension.java +++ b/server/src/com/vaadin/server/Extension.java @@ -29,8 +29,10 @@ package com.vaadin.server; * @since 7.0.0 */ public interface Extension extends ClientConnector { - /* - * Currently just an empty marker interface to distinguish between - * extensions and other connectors, e.g. components + + /** + * Remove this extension from its target. After an extension has been + * removed, it cannot be attached again. */ + void remove(); } diff --git a/server/src/com/vaadin/ui/JavaScript.java b/server/src/com/vaadin/ui/JavaScript.java index 3782ead85a..02707a3ccd 100644 --- a/server/src/com/vaadin/ui/JavaScript.java +++ b/server/src/com/vaadin/ui/JavaScript.java @@ -157,7 +157,7 @@ public class JavaScript extends AbstractExtension { * when invoked */ @Override - public void removeFromTarget() { + public void remove() { throw new UnsupportedOperationException( "JavaScript is not designed to be removed."); } |