Search in sources :

Example 1 with ModelReconcileAdapter

use of org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter in project webtools.sourceediting by eclipse.

the class ExtensionsSection method setInput.

public void setInput(IWorkbenchPart part, ISelection selection) {
    super.setInput(part, selection);
    if (adapter == null) {
        if (selection instanceof StructuredSelection) {
            Object obj = ((StructuredSelection) selection).getFirstElement();
            if (obj instanceof XSDConcreteComponent) {
                Element element = ((XSDConcreteComponent) obj).getElement();
                if (element != null) {
                    adapter = XSDModelAdapter.lookupOrCreateModelAdapter(element.getOwnerDocument());
                    if (adapter != null) {
                        ModelReconcileAdapter modelReconcileAdapter = adapter.getModelReconcileAdapter();
                        if (modelReconcileAdapter != null) {
                            modelReconcileAdapter.addListener(internalNodeAdapter);
                        }
                    }
                }
            }
        }
    }
    extensionTreeViewer.expandToLevel(2);
}
Also used : XSDConcreteComponent(org.eclipse.xsd.XSDConcreteComponent) Element(org.w3c.dom.Element) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) ModelReconcileAdapter(org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter)

Aggregations

StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 ModelReconcileAdapter (org.eclipse.wst.xsd.ui.internal.util.ModelReconcileAdapter)1 XSDConcreteComponent (org.eclipse.xsd.XSDConcreteComponent)1 Element (org.w3c.dom.Element)1