]> source.dussan.org Git - vaadin-framework.git/commitdiff
Refactor Extension API (#10337) 55/355/2
authorLeif Åstrand <leif@vaadin.com>
Fri, 23 Nov 2012 09:38:20 +0000 (11:38 +0200)
committerLeif Åstrand <leif@vaadin.com>
Fri, 23 Nov 2012 09:38:20 +0000 (11:38 +0200)
Change-Id: Ib16ffceb8dce235b59848c55e59407074e7d5bda

server/src/com/vaadin/server/AbstractExtension.java
server/src/com/vaadin/server/Extension.java
server/src/com/vaadin/ui/JavaScript.java
uitest/src/com/vaadin/tests/components/FileDownloaderTest.java
uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java

index 747caee967989416f49e109c053d06dec061f7f9..19c904163e97385f8b39afcf32682761fb9b6b88 100644 (file)
@@ -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);
     }
 
index bb7d133e8e26e23f4f4e7597fe1e09173bd9e02f..1bb61ab96e3fcc0c5ccf42c6653a27d4ddf223ec 100644 (file)
@@ -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();
 }
index 3782ead85a5675b0f39520f58f0d1e3abbe89864..02707a3ccd8f1364b7334853da7992cfb343f5e2 100644 (file)
@@ -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.");
     }
index 55d2afd32d469ee1d831eb894939a879b1ae5e74..6e0616b115094a941d11b69ef9188ecb2794c870 100644 (file)
@@ -130,7 +130,7 @@ public class FileDownloaderTest extends AbstractTestUI {
                     public void buttonClick(ClickEvent event) {
                         FileDownloader e = (FileDownloader) firstDownloadComponent
                                 .getExtensions().iterator().next();
-                        e.removeFromTarget();
+                        e.remove();
                         log.log("FileDownload detached");
                     }
                 }));
index ca53427e91080dff330d5f9fe6b6d16f9aa1edf3..427c71b381abb277d6d6ae29fbfb933cabd6c326 100644 (file)
@@ -38,7 +38,7 @@ public class BasicExtensionTest extends AbstractTestUI {
         addComponent(new Button("Remove root extension", new ClickListener() {
             @Override
             public void buttonClick(ClickEvent event) {
-                rootExtension.removeFromTarget();
+                rootExtension.remove();
             }
         }));
     }