[148433] After deleting anonymous complex type, the design view should remain in the detailed view of the element
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
index ee440b4..6d269a4 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDAnyTypeDefinitionAdapter.java
@@ -25,5 +25,10 @@
public String[] getActions(Object object)
{
return null;
+ }
+
+ public boolean isAnonymous()
+ {
+ return false;
}
}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
index ee6175c..f7d544d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDComplexTypeDefinitionAdapter.java
@@ -416,4 +416,10 @@
{
return true;
}
+
+ public boolean isAnonymous()
+ {
+ XSDComplexTypeDefinition xsdComplexTypeDefinition = (XSDComplexTypeDefinition) target;
+ return !(xsdComplexTypeDefinition.eContainer() instanceof XSDSchema);
+ }
}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
index f162c49..6690f53 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/adapters/XSDSimpleTypeDefinitionAdapter.java
@@ -20,6 +20,7 @@
import org.eclipse.wst.xsd.ui.internal.common.actions.DeleteXSDConcreteComponentAction;
import org.eclipse.wst.xsd.ui.internal.editor.Messages;
import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
+import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDVariety;
import org.eclipse.xsd.util.XSDConstants;
@@ -148,4 +149,10 @@
return (String [])list.toArray(new String[0]);
}
+
+ public boolean isAnonymous()
+ {
+ XSDSimpleTypeDefinition xsdSimpleTypeDefinition = (XSDSimpleTypeDefinition) target;
+ return !(xsdSimpleTypeDefinition.eContainer() instanceof XSDSchema);
+ }
}
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
index d654e32..af1d60b 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/DeleteAction.java
@@ -46,7 +46,7 @@
{
command = ((IComplexType)selection).getDeleteCommand();
model = ((IComplexType)selection).getModel();
- doReselect = true;
+ doReselect = !((IComplexType)selection).isAnonymous();
}
else if (selection instanceof IField)
{
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java
index cdc553a..cfd1adc 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/facade/IType.java
@@ -18,6 +18,7 @@
String getName();
String getQualifier();
boolean isComplexType();
+ boolean isAnonymous();
Command getUpdateNameCommand(String newName);
}