commit | 977d291afa15b29f9073f6de0116023257b0bef9 | [log] [tgz] |
---|---|---|
author | kchong <kchong> | Wed Apr 26 22:53:13 2006 +0000 |
committer | kchong <kchong> | Wed Apr 26 22:53:13 2006 +0000 |
tree | 2cfef5e2ee1661c2901096be52468029ab66b536 | |
parent | a0c48b24dff6ca7307d5b75c963a97297eeed5c1 [diff] |
[no bug] check isFocusAllowed before setting input
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java index b9dd4f5..c266304 100644 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java +++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/DesignViewGraphicalViewer.java
@@ -24,6 +24,7 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IEditorPart; import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart; +import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IGraphElement; import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IModelProxy; import org.eclipse.wst.xsd.ui.internal.adt.editor.CommonSelectionManager; import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject; @@ -66,7 +67,13 @@ if (((getInput() instanceof IModel) && (event.getSource() instanceof ADTContentOutlinePage)) || (!(getInput() instanceof IModel))) { - ((RootContentEditPart) getContents()).setInput(selectedObject); + if (selectedObject instanceof IGraphElement) + { + if (((IGraphElement)selectedObject).isFocusAllowed()) + { + ((RootContentEditPart) getContents()).setInput(selectedObject); + } + } } } else if (selectedObject instanceof IField)
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java index 34f51fb..f28a03e 100644 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java +++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/editparts/RootContentEditPart.java
@@ -87,7 +87,11 @@ IADTObject focusObject = null; if (obj instanceof IStructure) { - focusObject = (IStructure)obj; + if (obj instanceof IGraphElement) + { + if (((IGraphElement)obj).isFocusAllowed()) + focusObject = (IStructure)obj; + } } else if (obj instanceof IField) {