[139151] [ACC] Schema editor design page not keyboard navigable
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java
index 81b357a..dfc4e82 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/design/BaseGraphicalViewerKeyHandler.java
@@ -104,6 +104,7 @@
return true;
}
case SWT.F3 :
+ case SWT.CR :
{
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
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 d15aaf2..5d74c4a 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
@@ -207,7 +207,7 @@
for (Iterator i = parent.getChildren().iterator(); i.hasNext(); )
{
EditPart editPart = (EditPart)i.next();
- if (editPart.getModel() == object && !(editPart instanceof IHolderEditPart))
+ if (editPart.getModel() == object && !(editPart instanceof IHolderEditPart) && !(editPart instanceof RootContentEditPart))
{
result = editPart;
break;
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
index 896e056..31a5291 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/actions/OpenInNewEditor.java
@@ -32,6 +32,7 @@
import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
import org.eclipse.wst.xsd.ui.internal.editor.XSDFileEditorInput;
import org.eclipse.xsd.XSDConcreteComponent;
+import org.eclipse.xsd.XSDFeature;
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSchemaDirective;
import org.eclipse.xsd.impl.XSDImportImpl;
@@ -61,8 +62,15 @@
XSDBaseAdapter xsdAdapter = (XSDBaseAdapter) selection;
XSDConcreteComponent fComponent = (XSDConcreteComponent) xsdAdapter.getTarget();
XSDSchema schema = fComponent.getSchema();
+
+ boolean isReference = false;
+ if (fComponent instanceof XSDFeature)
+ {
+ isReference = ((XSDFeature)fComponent).isFeatureReference();
+ fComponent = ((XSDFeature)fComponent).getResolvedFeature();
+ }
- if (fComponent.getSchema() != null)
+ if (fComponent.getSchema() != null && fComponent.eContainer() instanceof XSDSchema || isReference)
{
String schemaLocation = URIHelper.removePlatformResourceProtocol(fComponent.getSchema().getSchemaLocation());
IPath schemaPath = new Path(schemaLocation);
@@ -102,7 +110,7 @@
// This first check is to ensure that the schema is actually
// different than the current one we are editing against in the editor, and that we
// are in the same resource file....hence multiple schemas in the same file.
- if (xsdSchema != null && fComponent.getRootContainer().eResource() == xsdSchema.eResource())
+ if (xsdSchema != null && fComponent.getRootContainer().eResource() == xsdSchema.eResource() && xsdSchema != schema)
{
XSDFileEditorInput xsdFileEditorInput = new XSDFileEditorInput(schemaFile, fComponent.getSchema());
IEditorPart activeEditor = page.getActiveEditor();