// then one exists, and the new one is truely different, so we need to
// release and remove current factories
if (embeddedTypeHandler != null) {
Iterator list = embeddedFactoryRegistry.iterator();
while (list.hasNext()) {
INodeAdapterFactory factory = (INodeAdapterFactory) list.next();
factory.release();
}
embeddedFactoryRegistry.clear();
}
embeddedTypeHandler = handler;
// when the handler is set, "transfer" its factories to our own list.
// note: our own list may also be added to else where, such as on
// "editor side".
if (embeddedTypeHandler != null) {
Iterator iterator = embeddedTypeHandler.getAdapterFactories().iterator();
while (iterator.hasNext()) {
INodeAdapterFactory factory = (INodeAdapterFactory) iterator.next();
embeddedFactoryRegistry.add(factory);
}
}
}