use of org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory in project webtools.sourceediting by eclipse.
the class HTMLValidator method validate.
private HTMLValidationResult validate(IReporter reporter, IFile file, IDOMModel model) {
if (file == null || model == null)
// error
return null;
IDOMDocument document = model.getDocument();
if (document == null)
// error
return null;
if (!hasHTMLFeature(document))
// ignore
return null;
INodeAdapterFactory factory = HTMLValidationAdapterFactory.getInstance();
ValidationAdapter adapter = (ValidationAdapter) factory.adapt(document);
if (adapter == null)
// error
return null;
HTMLValidationReporter rep = getReporter(reporter, file, model);
rep.clear();
adapter.setReporter(rep);
adapter.validate(document);
return rep.getResult();
}
use of org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory 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.provisional.INodeAdapterFactory in project webtools.sourceediting by eclipse.
the class PageDirectiveAdapterImpl method release.
public void release() {
if (embeddedTypeHandler != null) {
if (embeddedFactoryRegistry != null) {
Iterator iterator = embeddedFactoryRegistry.iterator();
INodeAdapterFactory factory = null;
while (iterator.hasNext()) {
factory = (INodeAdapterFactory) iterator.next();
factory.release();
}
}
// pa_TODO: possibly need to release here...
// or "uninitializeFactoryRegistry"
// initializeFactoryRegistry was called from JSPModelLoader
embeddedTypeHandler = null;
}
}
use of org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory in project webtools.sourceediting by eclipse.
the class ModelManagerImpl method addFactories.
private void addFactories(IStructuredModel model, List factoryList) {
// $NON-NLS-1$
Assert.isNotNull(model, "model can not be null");
FactoryRegistry registry = model.getFactoryRegistry();
// $NON-NLS-1$
Assert.isNotNull(registry, "model's Factory Registry can not be null");
// already exists. May need to reconsider this.
if (factoryList != null) {
Iterator iterator = factoryList.iterator();
while (iterator.hasNext()) {
INodeAdapterFactory factory = (INodeAdapterFactory) iterator.next();
registry.addFactory(factory);
}
}
}
use of org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory in project webtools.sourceediting by eclipse.
the class PluginContributedFactoryReader method loadRegistry.
protected List loadRegistry(Object contentType) {
// new Vector();
List factoryList = null;
IExtensionRegistry extensionRegistry = Platform.getExtensionRegistry();
IExtensionPoint point = extensionRegistry.getExtensionPoint(SSECorePlugin.ID, EXTENSION_POINT_ID);
if (point != null) {
IConfigurationElement[] elements = point.getConfigurationElements();
if (elements.length > 0) {
// this is called a lot, so don't create vector unless really
// needed
// TODO: could eventually cache in a hashtable, or something,
// to avoid repeat processing
factoryList = new Vector();
for (int i = 0; i < elements.length; i++) {
INodeAdapterFactory factory = loadFactoryFromConfigurationElement(elements[i], contentType);
if (factory != null)
factoryList.add(factory);
}
}
}
return factoryList;
}
Aggregations