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);
}
* @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();
}
* when invoked
*/
@Override
- public void removeFromTarget() {
+ public void remove() {
throw new UnsupportedOperationException(
"JavaScript is not designed to be removed.");
}
public void buttonClick(ClickEvent event) {
FileDownloader e = (FileDownloader) firstDownloadComponent
.getExtensions().iterator().next();
- e.removeFromTarget();
+ e.remove();
log.log("FileDownload detached");
}
}));
addComponent(new Button("Remove root extension", new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
- rootExtension.removeFromTarget();
+ rootExtension.remove();
}
}));
}