summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-03-12 16:29:10 (EDT)
committerEike Stepper2007-03-12 16:29:10 (EDT)
commite6f0a856f62875ce609bb2b9c861b29fe51d0ca4 (patch)
tree0b454692d6f26f90086b0dc3991943e168095207
parent4dfd056b256be2313d8e08bf01167dfdb3656bd2 (diff)
downloadcdo-e6f0a856f62875ce609bb2b9c861b29fe51d0ca4.zip
cdo-e6f0a856f62875ce609bb2b9c861b29fe51d0ca4.tar.gz
cdo-e6f0a856f62875ce609bb2b9c861b29fe51d0ca4.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/container/ManagedContainer.java27
1 files changed, 17 insertions, 10 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/container/ManagedContainer.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/container/ManagedContainer.java
index 96539c5..da8189d 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/container/ManagedContainer.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/util/container/ManagedContainer.java
@@ -130,16 +130,12 @@ public class ManagedContainer extends Notifier implements IManagedContainer
Object element = elementRegistry.get(key);
if (element == null)
{
- IFactory factory = getFactory(productGroup, factoryType);
- if (factory != null)
+ element = createElement(productGroup, factoryType, description);
+ if (element != null)
{
- element = factory.create(description);
- if (element != null)
- {
- key.setID(++maxElementID);
- elementRegistry.put(key, element);
- fireEvent(new SingleDeltaContainerEvent(this, element, IContainerDelta.Kind.ADDED));
- }
+ key.setID(++maxElementID);
+ elementRegistry.put(key, element);
+ fireEvent(new SingleDeltaContainerEvent(this, element, IContainerDelta.Kind.ADDED));
}
}
@@ -223,7 +219,18 @@ public class ManagedContainer extends Notifier implements IManagedContainer
}
}
- public void initMaxElementID()
+ protected Object createElement(String productGroup, String factoryType, String description)
+ {
+ IFactory factory = getFactory(productGroup, factoryType);
+ if (factory != null)
+ {
+ return factory.create(description);
+ }
+
+ return null;
+ }
+
+ protected void initMaxElementID()
{
synchronized (elementRegistry)
{