summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-17 04:52:55 (EDT)
committerEike Stepper2007-10-17 04:52:55 (EDT)
commitbb0da9583a86903c54c8e86246c4b038e442dc84 (patch)
tree05edddf6450f49beb429771c8aa0b1d82ab063a5
parentb9010bb3eda49d584ee4aa26366b91762ac339c3 (diff)
downloadcdo-bb0da9583a86903c54c8e86246c4b038e442dc84.zip
cdo-bb0da9583a86903c54c8e86246c4b038e442dc84.tar.gz
cdo-bb0da9583a86903c54c8e86246c4b038e442dc84.tar.bz2
[206224] Provide chat example
https://bugs.eclipse.org/bugs/show_bug.cgi?id=206224
-rw-r--r--plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java28
1 files changed, 26 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
index de33e23..bfadcbc 100644
--- a/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
+++ b/plugins/org.eclipse.net4j.util.ui/src/org/eclipse/net4j/util/ui/views/ContainerItemProvider.java
@@ -72,11 +72,19 @@ public class ContainerItemProvider<CONTAINER extends IContainer<Object>> extends
for (Iterator<Node> it = children.iterator(); it.hasNext();)
{
Node child = it.next();
- Object childElement = child.getElement();
- if (!LifecycleUtil.isActive(childElement))
+ if (child.isDisposed())
{
it.remove();
}
+ else
+ {
+ Object childElement = child.getElement();
+ if (!LifecycleUtil.isActive(childElement))
+ {
+ it.remove();
+ child.dispose();
+ }
+ }
}
Object[] result = new Object[children.size()];
@@ -183,6 +191,8 @@ public class ContainerItemProvider<CONTAINER extends IContainer<Object>> extends
{
public void dispose();
+ public boolean isDisposed();
+
public Object getElement();
public Node getParent();
@@ -199,6 +209,8 @@ public class ContainerItemProvider<CONTAINER extends IContainer<Object>> extends
private List<Node> children;
+ private boolean disposed;
+
public AbstractNode(Node parent)
{
this.parent = parent;
@@ -217,6 +229,13 @@ public class ContainerItemProvider<CONTAINER extends IContainer<Object>> extends
children.clear();
children = null;
}
+
+ disposed = true;
+ }
+
+ public boolean isDisposed()
+ {
+ return disposed;
}
@Override
@@ -377,6 +396,11 @@ public class ContainerItemProvider<CONTAINER extends IContainer<Object>> extends
parent = null;
}
+ public boolean isDisposed()
+ {
+ return element == null;
+ }
+
public Node getParent()
{
return parent;