Search in sources :

Example 1 with DebugAdapterFactory

use of org.eclipse.wst.xml.core.internal.DebugAdapterFactory in project webtools.sourceediting by eclipse.

the class JSPModelLoader method preLoadAdapt.

protected void preLoadAdapt(IStructuredModel structuredModel) {
    super.preLoadAdapt(structuredModel);
    IDOMModel domModel = (IDOMModel) structuredModel;
    // 
    // document must have already been set for this to
    // work.
    Document document = domModel.getDocument();
    Assert.isNotNull(document);
    // if there is a model in the adapter, this will adapt it to
    // first node. After that the PropagatingAdater spreads over the
    // children being
    // created. Each time that happends, a side effect is to
    // also "spread" sprecific registered adapters,
    // they two can propigate is needed.
    // This 'get' causes first to be be attached.
    PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document).getAdapterFor(PropagatingAdapter.class);
    // may make this easier to use in futue
    propagatingAdapter.addAdaptOnCreateFactory(new PageDirectiveWatcherFactory());
    if (Debug.debugNotificationAndEvents) {
        propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
    }
    // For JSPs, the ModelQueryAdapter must be "attached" to the document
    // before content is set in the model, so taglib initization can
    // take place.
    ((INodeNotifier) document).getAdapterFor(ModelQueryAdapter.class);
// 
}
Also used : IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) DebugAdapterFactory(org.eclipse.wst.xml.core.internal.DebugAdapterFactory) PropagatingAdapter(org.eclipse.wst.sse.core.internal.PropagatingAdapter) Document(org.w3c.dom.Document) IDOMDocument(org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument) IDocument(org.eclipse.jface.text.IDocument) BasicStructuredDocument(org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument) IStructuredDocument(org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument) PageDirectiveWatcherFactory(org.eclipse.jst.jsp.core.internal.document.PageDirectiveWatcherFactory) INodeNotifier(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)

Example 2 with DebugAdapterFactory

use of org.eclipse.wst.xml.core.internal.DebugAdapterFactory in project webtools.sourceediting by eclipse.

the class HTMLModelLoader method preLoadAdapt.

protected void preLoadAdapt(IStructuredModel structuredModel) {
    super.preLoadAdapt(structuredModel);
    // DMW: just added this preload on 8/16/2002
    // I noticed the ProagatingAdapterFactory was being added,
    // that that the ProagatingAdapterAdapter was not being
    // preload adapted -- I'm assuing it ALWAYS has to be.
    IDOMModel domModel = (IDOMModel) structuredModel;
    // if there is a model in the adapter, this will adapt it to
    // first node. After that the PropagatingAdater spreads over the
    // children being
    // created. Each time that happends, a side effect is to
    // also "spread" sprecific registered adapters,
    // they two can propigate is needed.
    ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
    if (Debug.debugNotificationAndEvents) {
        PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
        propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
    }
}
Also used : IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) DebugAdapterFactory(org.eclipse.wst.xml.core.internal.DebugAdapterFactory) PropagatingAdapter(org.eclipse.wst.sse.core.internal.PropagatingAdapter) INodeNotifier(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)

Example 3 with DebugAdapterFactory

use of org.eclipse.wst.xml.core.internal.DebugAdapterFactory in project webtools.sourceediting by eclipse.

the class XMLModelLoader method preLoadAdapt.

protected void preLoadAdapt(IStructuredModel structuredModel) {
    super.preLoadAdapt(structuredModel);
    IDOMModel domModel = (IDOMModel) structuredModel;
    // if there is a model in the adapter, this will adapt it to
    // first node. After that the PropagatingAdater spreads over the
    // children being
    // created. Each time that happends, a side effect is to
    // also "spread" sprecific registered adapters,
    // they two can propigate is needed.
    ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
    if (Debug.debugNotificationAndEvents) {
        PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
        propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
    }
}
Also used : IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) DebugAdapterFactory(org.eclipse.wst.xml.core.internal.DebugAdapterFactory) PropagatingAdapter(org.eclipse.wst.sse.core.internal.PropagatingAdapter) INodeNotifier(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)

Example 4 with DebugAdapterFactory

use of org.eclipse.wst.xml.core.internal.DebugAdapterFactory in project webtools.sourceediting by eclipse.

the class XSLModelLoader method preLoadAdapt.

@Override
protected void preLoadAdapt(IStructuredModel structuredModel) {
    super.preLoadAdapt(structuredModel);
    IDOMModel domModel = (IDOMModel) structuredModel;
    // if there is a model in the adapter, this will adapt it to
    // first node. After that the PropagatingAdater spreads over the
    // children being
    // created. Each time that happends, a side effect is to
    // also "spread" sprecific registered adapters,
    // they two can propigate is needed.
    ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
    if (Debug.debugNotificationAndEvents) {
        PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) domModel.getDocument()).getAdapterFor(PropagatingAdapter.class);
        propagatingAdapter.addAdaptOnCreateFactory(new DebugAdapterFactory());
    }
}
Also used : IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) DebugAdapterFactory(org.eclipse.wst.xml.core.internal.DebugAdapterFactory) PropagatingAdapter(org.eclipse.wst.sse.core.internal.PropagatingAdapter) INodeNotifier(org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)

Aggregations

PropagatingAdapter (org.eclipse.wst.sse.core.internal.PropagatingAdapter)4 INodeNotifier (org.eclipse.wst.sse.core.internal.provisional.INodeNotifier)4 DebugAdapterFactory (org.eclipse.wst.xml.core.internal.DebugAdapterFactory)4 IDOMModel (org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel)4 IDocument (org.eclipse.jface.text.IDocument)1 PageDirectiveWatcherFactory (org.eclipse.jst.jsp.core.internal.document.PageDirectiveWatcherFactory)1 IStructuredDocument (org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument)1 BasicStructuredDocument (org.eclipse.wst.sse.core.internal.text.BasicStructuredDocument)1 IDOMDocument (org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument)1 Document (org.w3c.dom.Document)1