summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/ComponentContainer.java
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2012-11-13 18:08:29 +0200
committerArtur Signell <artur@vaadin.com>2012-11-13 18:18:40 +0200
commit391884746fda1781c55b13bc200dd75373f69141 (patch)
tree0d5a8dcd9d13c5c39813d81252506e12d72741af /server/src/com/vaadin/ui/ComponentContainer.java
parent4628bcc3062ef19ed9d561f79fe3bfb3696d6e04 (diff)
downloadvaadin-framework-391884746fda1781c55b13bc200dd75373f69141.tar.gz
vaadin-framework-391884746fda1781c55b13bc200dd75373f69141.zip
UI based on AbstractBasicComponentContainer (#2924)
Change-Id: I1614a3464b8e7a0e9ecdd8c3a76335cdb85bdf87
Diffstat (limited to 'server/src/com/vaadin/ui/ComponentContainer.java')
-rw-r--r--server/src/com/vaadin/ui/ComponentContainer.java147
1 files changed, 4 insertions, 143 deletions
diff --git a/server/src/com/vaadin/ui/ComponentContainer.java b/server/src/com/vaadin/ui/ComponentContainer.java
index 3663134520..5ef41d7cbf 100644
--- a/server/src/com/vaadin/ui/ComponentContainer.java
+++ b/server/src/com/vaadin/ui/ComponentContainer.java
@@ -16,9 +16,10 @@
package com.vaadin.ui;
-import java.io.Serializable;
import java.util.Iterator;
+import com.vaadin.ui.HasComponents.ComponentAttachDetachNotifier;
+
/**
* Extension to the {@link Component} interface which adds to it the capacity to
* contain other components. All UI elements that can have child elements
@@ -27,7 +28,8 @@ import java.util.Iterator;
* @author Vaadin Ltd.
* @since 3.0
*/
-public interface ComponentContainer extends HasComponents {
+public interface ComponentContainer extends HasComponents,
+ ComponentAttachDetachNotifier {
/**
* Adds the component into this container.
@@ -102,14 +104,6 @@ public interface ComponentContainer extends HasComponents {
public void moveComponentsFrom(ComponentContainer source);
/**
- * Listens the component attach events.
- *
- * @param listener
- * the listener to add.
- */
- public void addComponentAttachListener(ComponentAttachListener listener);
-
- /**
* @deprecated Since 7.0, replaced by
* {@link #addComponentAttachListener(ComponentAttachListener)}
**/
@@ -117,14 +111,6 @@ public interface ComponentContainer extends HasComponents {
public void addListener(ComponentAttachListener listener);
/**
- * Stops the listening component attach events.
- *
- * @param listener
- * the listener to removed.
- */
- public void removeComponentAttachListener(ComponentAttachListener listener);
-
- /**
* @deprecated Since 7.0, replaced by
* {@link #removeComponentAttachListener(ComponentAttachListener)}
**/
@@ -132,11 +118,6 @@ public interface ComponentContainer extends HasComponents {
public void removeListener(ComponentAttachListener listener);
/**
- * Listens the component detach events.
- */
- public void addComponentDetachListener(ComponentDetachListener listener);
-
- /**
* @deprecated Since 7.0, replaced by
* {@link #addComponentDetachListener(ComponentDetachListener)}
**/
@@ -144,130 +125,10 @@ public interface ComponentContainer extends HasComponents {
public void addListener(ComponentDetachListener listener);
/**
- * Stops the listening component detach events.
- */
- public void removeComponentDetachListener(ComponentDetachListener listener);
-
- /**
* @deprecated Since 7.0, replaced by
* {@link #removeComponentDetachListener(ComponentDetachListener)}
**/
@Deprecated
public void removeListener(ComponentDetachListener listener);
- /**
- * Component attach listener interface.
- */
- public interface ComponentAttachListener extends Serializable {
-
- /**
- * A new component is attached to container.
- *
- * @param event
- * the component attach event.
- */
- public void componentAttachedToContainer(ComponentAttachEvent event);
- }
-
- /**
- * Component detach listener interface.
- */
- public interface ComponentDetachListener extends Serializable {
-
- /**
- * A component has been detached from container.
- *
- * @param event
- * the component detach event.
- */
- public void componentDetachedFromContainer(ComponentDetachEvent event);
- }
-
- /**
- * Component attach event sent when a component is attached to container.
- */
- @SuppressWarnings("serial")
- public static class ComponentAttachEvent extends Component.Event {
-
- private final Component component;
-
- /**
- * Creates a new attach event.
- *
- * @param container
- * the component container the component has been detached
- * to.
- * @param attachedComponent
- * the component that has been attached.
- */
- public ComponentAttachEvent(ComponentContainer container,
- Component attachedComponent) {
- super(container);
- component = attachedComponent;
- }
-
- /**
- * Gets the component container.
- *
- * @param the
- * component container.
- */
- public ComponentContainer getContainer() {
- return (ComponentContainer) getSource();
- }
-
- /**
- * Gets the attached component.
- *
- * @param the
- * attach component.
- */
- public Component getAttachedComponent() {
- return component;
- }
- }
-
- /**
- * Component detach event sent when a component is detached from container.
- */
- @SuppressWarnings("serial")
- public static class ComponentDetachEvent extends Component.Event {
-
- private final Component component;
-
- /**
- * Creates a new detach event.
- *
- * @param container
- * the component container the component has been detached
- * from.
- * @param detachedComponent
- * the component that has been detached.
- */
- public ComponentDetachEvent(ComponentContainer container,
- Component detachedComponent) {
- super(container);
- component = detachedComponent;
- }
-
- /**
- * Gets the component container.
- *
- * @param the
- * component container.
- */
- public ComponentContainer getContainer() {
- return (ComponentContainer) getSource();
- }
-
- /**
- * Gets the detached component.
- *
- * @return the detached component.
- */
- public Component getDetachedComponent() {
- return component;
- }
- }
-
}