Search in sources :

Example 1 with JFaceNodeAdapterFactoryForJSDT

use of org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterFactoryForJSDT in project webtools.sourceediting by eclipse.

the class AdapterFactoryProviderForJSDT method addContentBasedFactories.

protected void addContentBasedFactories(IStructuredModel structuredModel) {
    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    // $NON-NLS-1$
    Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry");
    INodeAdapterFactory factory = null;
    factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
    if (!(factory instanceof JFaceNodeAdapterFactoryForJSDT)) {
        factoryRegistry.removeFactoriesFor(IJFaceNodeAdapter.class);
        factory = new JFaceNodeAdapterFactoryForJSDT(IJFaceNodeAdapter.class, true);
        factoryRegistry.addFactory(factory);
    }
    JsTranslationAdapterFactory.setupAdapterFactory(structuredModel);
}
Also used : FactoryRegistry(org.eclipse.wst.sse.core.internal.model.FactoryRegistry) JFaceNodeAdapterFactoryForJSDT(org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterFactoryForJSDT) IJFaceNodeAdapter(org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter) INodeAdapterFactory(org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory)

Aggregations

JFaceNodeAdapterFactoryForJSDT (org.eclipse.wst.jsdt.web.ui.views.contentoutline.JFaceNodeAdapterFactoryForJSDT)1 FactoryRegistry (org.eclipse.wst.sse.core.internal.model.FactoryRegistry)1 INodeAdapterFactory (org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory)1 IJFaceNodeAdapter (org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter)1