Search in sources :

Example 6 with IJFaceNodeAdapter

use of org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter in project webtools.sourceediting by eclipse.

the class JFaceNodeContentProvider method getElements.

public Object[] getElements(Object object) {
    // The root is usually an instance of an JSONStructuredModel in
    // which case we want to extract the document.
    Object topNode = object;
    if (object instanceof IJSONModel) {
        topNode = ((IJSONModel) object).getDocument();
    }
    IJFaceNodeAdapter adapter = getAdapter(topNode);
    if (adapter != null) {
        return adapter.getElements(topNode);
    }
    return new Object[0];
}
Also used : IJSONModel(org.eclipse.wst.json.core.document.IJSONModel) IJFaceNodeAdapter(org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter)

Example 7 with IJFaceNodeAdapter

use of org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter in project webtools.sourceediting by eclipse.

the class JFaceNodeContentProvider method getElements.

public Object[] getElements(Object object) {
    // The root is usually an instance of an XMLStructuredModel in
    // which case we want to extract the document.
    Object topNode = object;
    if (object instanceof IDOMModel) {
        topNode = ((IDOMModel) object).getDocument();
    }
    IJFaceNodeAdapter adapter = getAdapter(topNode);
    if (adapter != null) {
        return adapter.getElements(topNode);
    }
    return new Object[0];
}
Also used : IDOMModel(org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel) IJFaceNodeAdapter(org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter)

Aggregations

IJFaceNodeAdapter (org.eclipse.wst.sse.ui.internal.contentoutline.IJFaceNodeAdapter)7 IDOMModel (org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel)3 Image (org.eclipse.swt.graphics.Image)1 IJSONModel (org.eclipse.wst.json.core.document.IJSONModel)1 Attr (org.w3c.dom.Attr)1 Element (org.w3c.dom.Element)1 NamedNodeMap (org.w3c.dom.NamedNodeMap)1 NodeList (org.w3c.dom.NodeList)1 Text (org.w3c.dom.Text)1