use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class InternalXSDMultiPageEditor method editorModeChanged.
public void editorModeChanged(EditorMode newEditorMode) {
// if (isInitializing)
// return;
EditPartFactory editPartFactory = newEditorMode.getEditPartFactory();
if (editPartFactory != null) {
graphicalViewer.setEditPartFactory(editPartFactory);
if (graphicalViewer instanceof DesignViewGraphicalViewer) {
DesignViewGraphicalViewer viewer = (DesignViewGraphicalViewer) graphicalViewer;
IADTObject input = viewer.getInput();
viewer.setInput(null);
// viewer.getRootEditPart().refresh();
// viewer.getRootEditPart().getContents().refresh();
viewer.setInput(input);
floatingToolbar.setEditPartFactory(editPartFactory);
floatingToolbar.setModel(getModel());
floatingToolbar.refresh(!(input instanceof IModel));
Control control = graphicalViewer.getControl();
if (control instanceof Composite) {
Composite parent = ((Composite) control).getParent();
parent.layout();
}
}
}
IContentProvider provider = newEditorMode.getOutlineProvider();
if (provider != null) {
ADTContentOutlinePage outline = (ADTContentOutlinePage) getContentOutlinePage();
if (outline != null) {
TreeViewer treeViewer = outline.getTreeViewer();
if (treeViewer != null) {
outline.getTreeViewer().setContentProvider(provider);
outline.getTreeViewer().refresh();
}
}
}
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class DesignViewNavigationLocation method restoreLocation.
public void restoreLocation() {
XSDSchema schema = (XSDSchema) getEditorPart().getAdapter(XSDSchema.class);
Object viewer = getEditorPart().getAdapter(GraphicalViewer.class);
if (viewer instanceof DesignViewGraphicalViewer) {
DesignViewGraphicalViewer graphicalViewer = (DesignViewGraphicalViewer) viewer;
XSDConcreteComponent component = Path.computeComponent(schema, path);
if (component != null) {
Adapter adapter = XSDAdapterFactory.getInstance().adapt(component);
if (adapter instanceof IADTObject) {
graphicalViewer.setInput((IADTObject) adapter);
}
} else if (path.segments.isEmpty()) {
Adapter adapter = XSDAdapterFactory.getInstance().adapt(schema);
if (adapter instanceof IADTObject) {
graphicalViewer.setInput((IADTObject) adapter);
}
}
}
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class XSDComplexTypeDefinitionAdapter method clearFields.
protected void clearFields() {
if (otherThingsToListenTo != null) {
for (Iterator i = otherThingsToListenTo.iterator(); i.hasNext(); ) {
Adapter adapter = (Adapter) i.next();
if (adapter instanceof IADTObject) {
IADTObject adtObject = (IADTObject) adapter;
adtObject.unregisterListener(this);
}
}
}
fields = null;
otherThingsToListenTo = null;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class XSDSimpleContentAdapter method getTopContainer.
public IADTObject getTopContainer() {
XSDConcreteComponent c = getXSDSimpleTypeContent().getContainer();
if (c instanceof XSDComplexTypeDefinition) {
XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition) c;
Adapter adapter = XSDAdapterFactory.getInstance().adapt(ct);
if (adapter instanceof IADTObject)
return (IADTObject) adapter;
}
return null;
}
use of org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject in project webtools.sourceediting by eclipse.
the class ADTContentOutlineRefreshJob method performRefreshes.
private void performRefreshes(IProgressMonitor monitor) {
IADTObject[] nodes = getNodesToRefresh();
for (int index = 0; index < nodes.length; index++) {
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
IADTObject node = nodes[index];
doRefresh(node);
}
}
Aggregations