[424276] Content-assist in XSD for a simpleType with user defined
restriction does not work
diff --git a/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
index 9cd01cd..b03e547 100644
--- a/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %_UI_PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.wst.xsd.core; singleton:=true
-Bundle-Version: 1.1.800.qualifier
+Bundle-Version: 1.1.900.qualifier
Bundle-Activator: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xsd.core/pom.xml b/bundles/org.eclipse.wst.xsd.core/pom.xml
index 9fabfcf..7e4d546 100644
--- a/bundles/org.eclipse.wst.xsd.core/pom.xml
+++ b/bundles/org.eclipse.wst.xsd.core/pom.xml
@@ -22,6 +22,6 @@
<groupId>org.eclipse.webtools.sourceediting</groupId>
<artifactId>org.eclipse.wst.xsd.core</artifactId>
- <version>1.1.800-SNAPSHOT</version>
+ <version>1.1.900-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
index 251b8a0..22ba263 100644
--- a/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
+++ b/bundles/org.eclipse.wst.xsd.core/src-contentmodel/org/eclipse/wst/xsd/contentmodel/internal/XSDImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2001, 2012 IBM Corporation and others.
+ * Copyright (c) 2001, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -390,6 +390,25 @@
if (baseType != null && !(type.getSchema().getSchemaForSchema() == baseType.getSchema()))
{
getEnumeratedValuesForSimpleType(baseType, result);
+ // Bug 424276 - The above is not sufficient. First check if there are enumerations for the base type.
+ // If there are none, then we should be able to add the enumerations for the current type
+ if (result.isEmpty())
+ {
+ getEnumeratedValuesForSimpleType(type, result);
+ }
+ else // There are enumerations on the base type
+ {
+ // If there are enumerations on the current type also, then we should just add the ones from the current type
+ // since we're restricting the values
+ List enumerationsForCurrentType = new ArrayList();
+ getEnumeratedValuesForSimpleType(type, enumerationsForCurrentType);
+ if (!enumerationsForCurrentType.isEmpty())
+ {
+ result.clear();
+ result.addAll(enumerationsForCurrentType);
+ }
+ // Otherwise, just use the enumerations on the base type
+ }
}
else
{