[148433] [XSD Editor] Cannot delete anonymous ComplexTypes in the Design View
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
index e6f68d0..5616185 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-common/org/eclipse/wst/xsd/ui/internal/common/commands/DeleteCommand.java
@@ -25,6 +25,7 @@
import org.eclipse.xsd.XSDSchema;
import org.eclipse.xsd.XSDSimpleTypeDefinition;
import org.eclipse.xsd.XSDWildcard;
+import org.eclipse.xsd.util.XSDConstants;
public class DeleteCommand extends BaseCommand
{
@@ -138,6 +139,10 @@
((XSDAttributeGroupDefinition)parent).setAttributeWildcardContent(null);
}
}
+ else if (target instanceof XSDComplexTypeDefinition && parent instanceof XSDElementDeclaration)
+ {
+ ((XSDElementDeclaration)parent).setTypeDefinition(target.resolveSimpleTypeDefinition(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001, "string"));
+ }
else
{
if (parent instanceof XSDSchema)