use of org.eclipse.wst.sse.core.internal.model.FactoryRegistry in project webtools.sourceediting by eclipse.
the class AdapterFactoryProviderForDTD method addAdapterFactories.
/*
* @see AdapterFactoryProvider#addAdapterFactories(IStructuredModel)
*/
public void addAdapterFactories(IStructuredModel structuredModel) {
FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
// $NON-NLS-1$
Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry");
}
use of org.eclipse.wst.sse.core.internal.model.FactoryRegistry in project webtools.sourceediting by eclipse.
the class AdapterFactoryProviderForHTML 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 == null) {
factory = new JFaceNodeAdapterFactoryForHTML();
factoryRegistry.addFactory(factory);
}
}
use of org.eclipse.wst.sse.core.internal.model.FactoryRegistry in project webtools.sourceediting by eclipse.
the class AdapterFactoryProviderForXML 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 == null) {
factory = new JFaceNodeAdapterFactory();
factoryRegistry.addFactory(factory);
}
//
if (structuredModel != null) {
ModelQuery modelQuery = ModelQueryUtil.getModelQuery(structuredModel);
if (modelQuery != null) {
CMDocumentManager documentManager = modelQuery.getCMDocumentManager();
if (documentManager != null) {
IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
boolean useInferredGrammar = (store != null) ? store.getBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR) : true;
documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, false);
documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_USE_CACHED_RESOLVED_URI, true);
DOMObserver domObserver = new DOMObserver(structuredModel);
domObserver.setGrammarInferenceEnabled(useInferredGrammar);
domObserver.init();
}
}
}
}
use of org.eclipse.wst.sse.core.internal.model.FactoryRegistry in project webtools.sourceediting by eclipse.
the class AdapterFactoryProviderForJSON 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 == null) {
factory = new JFaceNodeAdapterFactory();
factoryRegistry.addFactory(factory);
}
// cs... added for inferred grammar support
//
// if (structuredModel != null) {
// ModelQuery modelQuery = ModelQueryUtil.getModelQuery(structuredModel);
// if (modelQuery != null) {
// CMDocumentManager documentManager = modelQuery.getCMDocumentManager();
// if (documentManager != null) {
// IPreferenceStore store = XMLUIPlugin.getDefault().getPreferenceStore();
// boolean useInferredGrammar = (store != null) ? store.getBoolean(XMLUIPreferenceNames.USE_INFERRED_GRAMMAR) : true;
//
// documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_ASYNC_LOAD, true);
// documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_AUTO_LOAD, false);
// documentManager.setPropertyEnabled(CMDocumentManager.PROPERTY_USE_CACHED_RESOLVED_URI, true);
// DOMObserver domObserver = new DOMObserver(structuredModel);
// domObserver.setGrammarInferenceEnabled(useInferredGrammar);
// domObserver.init();
// }
// }
// }
}
use of org.eclipse.wst.sse.core.internal.model.FactoryRegistry in project webtools.sourceediting by eclipse.
the class AdapterFactoryProviderCSS 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 == null) {
factory = new JFaceNodeAdapterFactoryCSS(IJFaceNodeAdapter.class, true);
factoryRegistry.addFactory(factory);
}
}
Aggregations