public static void addFactoriesTo(final IStructuredModel structuredModel) {
if (structuredModel == null)
return;
AdapterFactoryRegistry adapterRegistry = SSEUIPlugin.getDefault().getAdapterFactoryRegistry();
String contentTypeId = structuredModel.getContentTypeIdentifier();
Iterator adapterFactoryProviders = null;
if (adapterRegistry instanceof AdapterFactoryRegistryExtension) {
adapterFactoryProviders = ((AdapterFactoryRegistryExtension) adapterRegistry).getAdapterFactories(contentTypeId);
}
else {
adapterFactoryProviders = adapterRegistry.getAdapterFactories();
}
FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
Assert.isNotNull(factoryRegistry, SSEUIMessages.EditorModelUtil_0); //$NON-NLS-1$
// Add all those appropriate for this particular type of content